all groups > sql server programming > september 2003 > threads for thursday september 11
Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Adding a field to a table programatically.
Posted by Jim Mitchell at 9/11/2003 10:41:04 PM
Can some one provide some samle SQL or VB Script to add a field to an
existing table. I did not see a Create Field Command in Transact-SQL.
Thanks in advance.
Jim
... more >>
xp_fileexist
Posted by mirage00 at 9/11/2003 10:39:00 PM
the table has a varchar column with filenames in it... I want a script that
iterates through the table and checks to see if the file exists... HELP!
Thanks in advance
... more >>
Dynamic execution of sprocs in Tsql?
Posted by Greg at 9/11/2003 9:52:05 PM
I would like to execute a list of sprocs based on the
values of a table column (the values are the sproc names).
How would I go about doing that? I want this to execute
on a defined schedule.
I have table 'statdefs':
cols: id, sprocname, sprocargs
So here's the flow I am going for:
-... more >>
Syntax Question
Posted by Wayne Wengert at 9/11/2003 8:13:58 PM
I want to delete all records in a table where a given field is Null. I am
using the following syntax but it does not delete the expected rows. What
did I do wrong?
Delete From myTable WHERE ((UnitID= " & varSelectedUnit & ") AND
(Withdrawdate Is Null))"
--
--------------------------------... more >>
Select MAX from Variables
Posted by Vincent V at 9/11/2003 7:48:08 PM
Hey i have 5 Variables
@1 INT
@2 INT
@3 INT
How can i efficiently select the max from these
I need this to be as efficient as possible
... more >>
Width of field in Select
Posted by Jonathan Blitz at 9/11/2003 7:16:49 PM
Is their some sort of limit on the width of field I can select from a table?
I have a field with over 500 chars in it but when I select from it I only
get the first 255!
Does this make any sense?
--
Jonathan Blitz
AnyKey Limited
Israel
"When things seem bad
Don't worry and shout
... more >>
MSDE 2Gb Limit
Posted by William Bartholomew at 9/11/2003 5:04:40 PM
Is this based just on data or on the log as well?
William D. Bartholomew... more >>
SQL and passing structures internally
Posted by Tomer at 9/11/2003 4:45:17 PM
Hi All,
Can you please direct me to the relevant article or just write whether SQL
2000 has any way to pass any structure internally between several objects
(RecordsSet or XML between Stored Procedures and/or Functions).
Please note that I don’t know in advance what will be the amount of dat... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Sending messages from SQL Server
Posted by Dave at 9/11/2003 4:39:09 PM
I want to send a message notification from SQL Server to a
web server (using SOAP or RPC XML or whatever) when an
update occurs on a particular table. Is this possible? I
want to avoid MSMQ if possible. The web server may not be
a .NET server.
Alternatively, I want to call a method on a w... more >>
Diagram Printing
Posted by microsoft at 9/11/2003 4:01:30 PM
how can i print a database diagram?
how can i print the fields from a specific table?
... more >>
Design Tools
Posted by BobT at 9/11/2003 3:48:47 PM
I have a number of applications written in Access. I need
to scale these applications up. I do like the design
tools built into Access. I would like the ability to
design standalone applications as well as multi-user
database applications. What tool would provide the
development envior... more >>
Is COMPUTE particularly slow?
Posted by Rob Rutherford at 9/11/2003 3:36:34 PM
I'm using a stand-alone machine running Win XP and SQL Server 2000.
The machine has a processor speed of 2.2 GHz and has 512 MB of RAM.
Using Query Analyzer, I ran the following query against the Northwind
sample database.
SELECT OrderId, ProductID, UnitPrice*Quantity AS TotalPrice
FROM [Orde... more >>
String was not recognised as a valid DateTime
Posted by Davef at 9/11/2003 3:30:40 PM
The field in the form is empty. If it has a date, it work. Any ideas?
Public Function UpdateSingleMachInfo(ByVal MachID As Integer, ByVal
DATE_PAID As String)
' Create Instance of Connection and Command Object
Dim myConnection As New
SqlConnection(Configura... more >>
Computed Column in view
Posted by bahu77 NO[at]SPAM hotmail.com at 9/11/2003 3:07:10 PM
Is it possible to have a computed column in a view?
Here is the view
-----------
CREATE VIEW C_VIEW (Q, B, A) AS
SELECT ID1, ID2, ID3 FROM TBL_A
-----------
I can do like this
-----------
CREATE VIEW C_VIEW (Q, B, A, C) AS
SELECT ID1, ID2, ID3, ID1+ID2+ID3 FROM TBL_A
-----------
C... more >>
Comparing similar strings
Posted by Jonathan Blitz at 9/11/2003 2:43:24 PM
I have an interesting problem.
I need to compare peoples names from tables that have been received from
different sources.
The problem is that different people tend to write names in different ways.
For example, my name may appear as: Jonathan Blitz or as Blitz Jonathan.
And since I also ha... more >>
3146: ODBC--call failed - Only when updating certain records
Posted by Coveblue at 9/11/2003 2:34:15 PM
I have a visual basic application which was custom written for our company
to handle our membership database. I no longer have access to support or
code. However, the database itself is on a Windows NT server using SQL
Server 6.5 (outdated, I know) and I do have access to that.
Occassionally... more >>
Selecting all my views from 'sysobjects'
Posted by d.flakowski NO[at]SPAM megalith-software.de at 9/11/2003 2:28:26 PM
Hello,
I want to select all the views I created in a DB to recompile them.
But if I make a "SELECT name FROM sysdatabases WHERE xtype='V'" then I
also get views like "REFERENTIAL_CONSTRAINTS" or "sysconstraints". But
these are - I think - built in views which I don't want to recompile.
So how... more >>
Profiler question
Posted by bob at 9/11/2003 2:23:32 PM
I'm trying to capture stored procedures when they
recompile. Thanks to Kalen I was able to figure out I was
using the wrong event. Now I am using the "cache Insert"
event, but it brings back EVERYTHING beside stored
procedures. I tried to narrow it down by entering objtype
equals to P (per... more >>
NPV
Posted by Dan H. at 9/11/2003 2:21:35 PM
hello,
I am new to SQL Server 2k. I am looking for any tutorials or references
dealing with calculating net present values (NPV) of costs and revenue
numbers.
I did a google but did not find anything to help me.
I basically have either quarterly, yearly data for revenue and cost for the
n... more >>
how can disable sql server to be access through internet ?
Posted by Daylor at 9/11/2003 2:21:13 PM
hi.
i wanted to know, how can i disable the option to query the sql server 2000
db ,through the internet (even from other computer )?
the application is only using the db from the local computer .
how can i enable access to sql server db's only from local computer ?
... more >>
temporary table in sysobjects
Posted by Jorr.it at 9/11/2003 2:19:20 PM
How can I check if a temporary table (#tbl) already exists? After creation,
I can't find it in the sysobjects table.
Thanks!
--
Jorrit
... more >>
Messy data
Posted by Tom Lewis at 9/11/2003 2:14:45 PM
I need to clean up a table from a spreadsheet where
parenthetic notes in a single column have been used to
track multiple data fields. Sometimes there are several
parenthetic notes in a single row, and in no particular
order.
I am hoping to develop T-SQL or vba code to parse through
the... more >>
COUNT function works improperly ???
Posted by randyv at 9/11/2003 1:55:38 PM
I'm trying to build a tracking table to record row counts
in various staging and target tables.
It is a basic trick of the trade, and I'm surprised to
find that it doesn't work on SQL Server.
I have a tracking table - TRKTBL:
datestamp datetime datatype
fromtable nva... more >>
Updating SQL
Posted by TK at 9/11/2003 1:49:40 PM
I am using C# datasets / ADO.NET to parse an XML file and use the data to
update SQL Server.
In the end the datatable contains something like 2000 rows, the columns of
which match up with parameters for a stored procedure used to determine if
the data should be inserted or not based on previou... more >>
Query help
Posted by susan at 9/11/2003 1:46:40 PM
The query below is running a little long. Anything I can
do to help speed it up??
select distinct A.batch_id from audit as A(NOLOCK),
audit_address as AA(NOLOCK)
where A.audit_id = AA.audit_id
and AA.resend_status in (1, 3)
Here's the schema in questions...
CREATE TABLE [dbo].[audit... more >>
Trying to understand what is wrong.
Posted by Alejandro Mesa at 9/11/2003 1:44:17 PM
Thanks in advance for any comment.
The other day I was trying to execute this batch, finding the max value =
in a group of variables with same datatype (see msg "select max from =
variables"), but I am getting this ugly error from SQL Server. I can not =
see what I am doing wrong.
decla... more >>
ReDesign Issues for a Production DB
Posted by RK at 9/11/2003 1:27:41 PM
Hello All & Greetings.
We all know how text books decribe how-to design good, logical / physical
databases. What I want to know is, what if one has to work with a production
DB (say, about 4 GB) but several tables in this production DB have to be
re-desinged, etc. But, all these tables have v... more >>
Stored procedures update
Posted by Dariusz Hoszowski at 9/11/2003 12:57:52 PM
Hi,
i wonder how to implement something like update procedure for ...
procedures on my server. For example - i have 22 stored procedures which are
stored on server. Now i won't to update for example 10 from them (i have
proc1.sql, proc2.sql, etc.). How to programaticaly update all 10 new sto... more >>
SQL equiv. to FIRST() and LAST() functions in Access?
Posted by Deke at 9/11/2003 12:42:58 PM
Hi,
Is there a SQL equivalent to the FIRST and LAST
functions that are in Access?
Thanks
Deke... more >>
HHHHHHHHHelp Image Data Type
Posted by parks at 9/11/2003 12:39:59 PM
Hi,
Graphical data in a field that has the Image data type,
how do you get the image to populate in the column????
After executing sql statement:
Select*
From custmers
Thanks... more >>
what's the limitation of the developer version of sql server 2000 ?
Posted by Daylor at 9/11/2003 12:33:29 PM
i know, that you can run the developer version in windows SERVER editions.
but is there other limitations ?
like no of open connections at the same time ?
... more >>
Float to decimal
Posted by Barbara at 9/11/2003 12:17:47 PM
I am trying to combine several similarly structured tables
into one table. Two of the tables (the ones that
reference Dublin below) have certain numeric fields as
Float while all other tables have those same fields as
Decimal (13,6). I would like my end result to be Decimal
(13,6).
My... more >>
Make a duplicate copy of a record in the same table
Posted by CyberSpider at 9/11/2003 12:13:43 PM
I need to make a duplicate copy of a record in the same table with the
exception of the identity field.
How do I do this. Below is an example of one of the tables.
The Loanid, Min, and LoanNumber are unique fields in this table and cannot
have duplicates.
Thanks
CREATE TABLE [Loan] (
... more >>
SQL Statement
Posted by Sanny Shaikh at 9/11/2003 11:59:33 AM
Hi,
I was wondering if there is a way to update a column using
if else logic. Basically,
If True
Update <table>
SET
<column> = 'value'
is this possible?... more >>
number of open connections to the db
Posted by Daylor at 9/11/2003 11:56:35 AM
hi.
i have sql server and a telephony application in the same computer.
the application is serving 30 phone lines with 30 threads.
when phone call arrvies, the thread that handle it , query the db (sync)
5-10 times in a minute.
the 30 threads exist all the time.
(and sometime ,there can be ... more >>
Optimizing a procedure
Posted by John Francisco Williams at 9/11/2003 11:27:33 AM
Hi all. I have the following procedure:
ALTER Procedure dbo.spChairSelect
(
@Xml NText
)
As
Declare
@xmdDocument Int,
@ChairToExcludeID Int,
@ChairID Int
Exec sp_XML_PrepareDocument @xmdDocument Output, @Xml
Select
... more >>
debugging trigger
Posted by Zeng at 9/11/2003 11:22:39 AM
Hello,
Is there a way to debug (set breakpoint etc..) into a trigger ?
Thank you very much in advance.
... more >>
Recompile HOW??
Posted by bob at 9/11/2003 11:21:40 AM
Sorry if you've seen this twice, I accidently added it to
server instead of programming group. My apologies.
I've been trying to figure out the "recompile" logic for a
while now and have just completed some testing, but still
have quite a few questions. I just need to verify that
what we ... more >>
Can I pass a variable on a View
Posted by Sandra at 9/11/2003 10:32:28 AM
Can I pass a variable on a view?
UPDATE VIEW
SET Name='Bob Barker'
WHERE Id = 1728
Thanks in advance for any help.
Sandra... more >>
Trigger-based audit logging to properly log old/new NULL
Posted by Ian Boyd at 9/11/2003 10:09:50 AM
i have a standard trigger-based audit logging system, where each field is
checked for a change in an UPDATE trigger.
From the virtual INSERTED and DELETED tabled, i record the old and new
values into a nullable varchar(8000) field.
Here is a snippit of the trigger code to check one field:
... more >>
Newbie needs code pages for SQL Server 2000 access from asp.net page using vb.net
Posted by Lori at 9/11/2003 9:23:24 AM
I am only trying to connect to a local host .
I am on Windows 2000 Server with sql 2000 server.
My error is the classic "SQL server does not exist or access denied"
I went to the MS site & they tell me what I know......"some" permissioning
issue.
I had this code working 2 months ago o... more >>
logical error converting an access query to an SQL view
Posted by eli.eli NO[at]SPAM striplingandbeck.com at 9/11/2003 7:38:54 AM
Hi,
I am trying to convert the following access query to an SQL view:
"
SELECT prj_code, invoice_nbr
FROM finance_ar_aging_action
GROUP BY prj_code, invoice_nbr
HAVING (Last(finance_ar_aging_action.payment_date) is not null); "
The problem here is that I cannot use the "Last" aggregate ... more >>
Update query and triggers
Posted by Brandon at 9/11/2003 7:35:29 AM
Hello,
If I run an update query, will the trigger be fired for
each record?
Thank you,
Brandon H. Campbell... more >>
Table seems corrupt.
Posted by Phil at 9/11/2003 6:25:04 AM
I have a fairly large database with around forty tables.
One of the main tables seems to be corrupt. If I try to
edit any of the fields in this table so they do not allow
now values I get an error. For example, if I try to
change the field "Household_CellPhone" so it doesn't
except null... more >>
stored proc dies - no real error !!!!
Posted by TANIA at 9/11/2003 5:43:06 AM
Please help
When debugging and running my stored proc it works just
fine ! I have sql 2000 sp3 client and server software.
When called via ODBC, it dies on one of the stored procs
that it is calling. When tracing it with sql profiler I
get a weird error on the call to the third SP it... more >>
Optimization an SP for searches
Posted by Stephen Mandeville at 9/11/2003 5:00:49 AM
I have a procedure that has been developped that has=20
generated alot of discussions for performance.
can someone look at this and give me some feedback and=20
solutions if it is not optimal.
CREATE PROCEDURE dbo.cp_Entity_Find_AdvanceSearch
(
@entityList varchar(2000) =3D '',
@entit... more >>
Msg 8525
Posted by Rob at 9/11/2003 2:37:28 AM
Ah, this is not a good day. I am getting the following
message when executing a distributed transaction:
Server: Msg 8525, Level 16, State 1, Line 1
Distributed transaction completed. Either enlist this
session in a new transaction or the NULL transaction.
[OLE/DB provider returned message:... more >>
ORDER BY Bug in SQL Server?
Posted by Andy Rohr at 9/11/2003 1:18:22 AM
I believe I found a Bug in MS SQL Server 8.0.
I have a query with an ORDER BY clause. The resultset is
about 10000 rows. Sometimes the ordering of the result is
not correct, but when I restart the sqlserver-process, at
least the first time the ordering is correct, but then
after executei... more >>
recordcount property returns -1
Posted by Vishal at 9/11/2003 12:40:53 AM
WHen i rs.recordcount where rs is recordset it returns -1
actually it is having more than 10 record then y it is
returning -1
i m using this command to open recordset
rs.open connectionstring,connection,3,3... more >>
TimeStamp
Posted by girishpal NO[at]SPAM hotmail.com at 9/11/2003 12:22:52 AM
How to retrieve the implicit timestamp added on each row by sql server using sql.
Thanks.... more >>
|