Archived Months
January 2003
March 2003
April 2003
May 2003
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
April 2008
all groups > sql server programming > august 2003 > threads for thursday august 21

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 31

Error 311
Posted by Bush at 8/21/2003 11:14:10 PM
Hi, I need to audit a column with Text datatype. SQL Server does not allowing me to use Text datatype with inserted/Deleted tables. I know this can be accomplished by using instead of trigger. But I need to update the base table and insert old 'n' new values (Text datatype) in Audit table....more >>


replication of a database
Posted by Frank Dulk at 8/21/2003 11:08:43 PM
I requested the help to do a replication of a database. We consulted Books Online, and other books, and we began to set up her replies. We are coming across the following situation: in all the read examples several servers exist, and in our case we want to create her he/she replies inside of th...more >>

Transaction log
Posted by Manoj at 8/21/2003 10:32:02 PM
Hi.. I have been asked many times the following question... "HOW TO SEE THE TRANSACTION LOG THROUGH ENTERPRIZES MANAGER" Well i think its not possible but i m not sure. U R any help will help me getting a forture. THANKS FROM THE HEART in advance Regards Manoj ...more >>

GO command
Posted by John Davis at 8/21/2003 10:28:09 PM
I still not sure what is GO command. In online spec, it says "Signals the end of a batch of Transact-SQL statements to the Microsoft® SQL ServerT utilities." Please give me more clear explaination. thanks, John ...more >>

auto start sql service when OS starts
Posted by jim at 8/21/2003 7:33:50 PM
Is there a way to auto start sql service when OS starts w/out using sql server service manager? That is, via code. any help is appreciated jim...more >>

Partial rollback of transaction
Posted by Serg Prokhorov at 8/21/2003 7:22:16 PM
What I mean by "partial" - I need some changes to remain in database after a rollback. It shall be used in a logging system - even for a unsuccessful long transaction I need to have some info about its progress and the reason of failure to stay in a log-table, to track and analyse it later. I u...more >>

Something rare!
Posted by Kenny at 8/21/2003 6:40:03 PM
Hi, I am having a rare situation when executing this store procedure: create procedure test AS declare @pk int begin tran insert tbltest (...) values(...) if @@ERROR = 0 BEGIN COMMIT TRAN SELECT * FROM vwWorkOrder WHERE PK=@@IDENTITY END else ROLLBACK TRAN GO this store pr...more >>

Accidentally Deleted a Few Rows
Posted by Scott Good at 8/21/2003 5:01:28 PM
Ok, I accidentally deleted a few rows. However, I do have a backup. Is there a way to restore from the backup those rows that I deleted instead of the entire database? I thought that maybe in the worst-case scenario I could use DTS. Scott...more >>



Dynamic SQL with variables in user-defined Functions
Posted by Bruce at 8/21/2003 4:44:26 PM
I need to create a dynamic SQL statement in a user-defined function, but the statement needs to return values back into local variables: SELECT @s = N'select @num=TheColumn FROM MyTable' to do this, I need to use sp_executesql: EXEC sp_executesql @s, N'@num int OUTPUT', @num OUTPUT but ...more >>

Command parser question
Posted by Bob at 8/21/2003 4:19:21 PM
I recently noticed in code I'm maintaining that several queries of the form select id from table1 where idasint=10order by idasint are being sent to SQL Server. I kind of expected a parse error but maybe not. I tried various other statements to test the limits of the parser such as se...more >>

SQL Help!
Posted by Amit Sinha at 8/21/2003 4:09:45 PM
I have a table with MID PID date bcode seg 1 1 1/1/03 9 1 1 2/1/03 8 1 1 3/1/03 8 1 2 1/1/03 9 1 2 2/1/03 7 1 3 1/1/03 8 1 3 2/1/03 ...more >>

Ask for deleted lines in SQL Clause
Posted by Leandro Loureiro dos Santos at 8/21/2003 3:56:11 PM
Friends, How can i get the number of lines affected by a delete command? I want to know this number, after this happened, not before with a select. Thanks Leandro Loureiro dos Santos Vitória-ES / BRAZIL ...more >>

Sql Newbie RAC'in his brain
Posted by Ron Weiner at 8/21/2003 3:49:46 PM
Hi, I am a SQL newbie trying my best to learn how use, maintain and create Stored Procedures. I recently bought a SQL addin RAC that makes it simple to create Access Type CrossTab Queries. Basically RAC is a stored procedure that uses a (truly mind numbing) number of parameters. I am Singing a...more >>

Using FETCH to parse a delimited string
Posted by mmaxsom NO[at]SPAM citlink.net at 8/21/2003 3:29:10 PM
Hello, I need some guidance. Ok, here goes... I created a stored proc to FETCH rows from one column in a table that are delimited with a semi-colon. Example: Codes ------- A1234;W1234;TM4545 A1234;W1234 A1234;A21234;W1234;W21234;TM4545;TM24545 The next step was to insert these r...more >>

Efficient solution
Posted by fabriZio at 8/21/2003 3:27:50 PM
I have a table [CAR] Guid UNIQUEIDENTIFIER NEWID() Car VARCHAR(20) I have a table [Components] Id INT Identity(1, 1) NOT NULL Component I have to build another table that will look (i think) in this way: Id INT Identity(1, 1) NOT NULL Car_Guid UNIQUEIDENTIFIER -- Foreign key of C...more >>

Update Question
Posted by Paulo at 8/21/2003 3:23:39 PM
I want to preficate that I had nothing to do with coming up with this convention, but I am tasked with correcting the situation. This is where I need your help. Here is the situation. I have a table with four columns. Customer( ID int, LastName varchar(50), FirstName varchar(50), C...more >>

How to Select Records NOT in another table?
Posted by Jankins at 8/21/2003 3:09:24 PM
I have: Table1 and Table2 ID [Integer] ID[Integer] with these records in Table1: 1 2 3 4 and these records in Table2: 2 3 I'd like a select statement that retrieves record 1 and 4 out of Table1 - Can anyone enlighten me? Thank you! Dan ...more >>

Multiple Join Problem
Posted by Tobe at 8/21/2003 2:57:50 PM
I am trying to get each product ID, its description, and its category (obsolete products do not have a category) by going through an intermediate table. The following query gives an error: "The table 'ItemCategories' is an inner member of an outer join clause. This is not allowed if t...more >>

Copying a table definition and populating it
Posted by Chris Strug at 8/21/2003 2:03:04 PM
Hi, Probably a simple question but say I have a table. I wish to copy the structure of that table into a new table (in the same database). From there I wish to move certain records from the original table, for example all records before a certain date into this new table. Can anyone point...more >>

Joining two tables where ID's from one table is selected using LIKE %XXX (Index hints ?)
Posted by Tom Erik Kristiansen at 8/21/2003 2:01:10 PM
Hi The problem I want to join table1 with table2 where idTable1(indexed) = idTable2(indexed) Table2 is a "small" table 1 mill records, table1 is quite big 15 mill records. A. When I do the where on table2, using LIKE 'xxxx%' is is fast ! B. When I do the where on table2, using LIKE '%x...more >>

linked server
Posted by New DBA at 8/21/2003 1:52:06 PM
How do I pass a datetime paramter to linked server using OPENQUERY ? Any help is appreciated....more >>

Request for Help one more time...
Posted by Ricky at 8/21/2003 1:50:32 PM
Hi guys, If you look down below in the window there is an unanswered post. I posted it in the morning. It is a long one as it contains the DDL. First part just creates a table and next 20 lines are just plain inserts to this table so that you guys can mimic for the scenario and come up ...more >>

INSERT INTO ... EXEC sp_who
Posted by A.M at 8/21/2003 1:25:05 PM
Hi, I know that i can store result of a stored procedure into a table with TSQL command like this: INSERT INTO tblWho EXEC sp_who The problem is INERT INTO needs a pre-created table matches with column name/type returened by stored procedure. Is there any command that create a table and ...more >>

Reference a remote SQL Server
Posted by Bill Willyerd at 8/21/2003 1:13:47 PM
I need to update my SQL 2K server with data from another SQL 2K server that I have been granted limited rights to. I have tried a view with the Server.Database.Table.Field and get the "contains more than the maximum number of prefixes. The maximum number is 3.' error. I did Exec sp_addlinkedser...more >>

Dubs
Posted by sardinka at 8/21/2003 1:00:55 PM
I have need to find out the dublicate records: In Table I have [ID] and lastname and firstname. lastname and firstname may be the same, but different id. How do I found the students with the same firstname and lastname....more >>

Transaction logs...
Posted by Paul M at 8/21/2003 12:50:08 PM
Hi, Is there a way of stopping SQL server 2K form recording transactions in it's log when processing records in stored procedures.. I have a number of sprocs that need to process data into tables that are used for reporting. We can't use temporary tables because the software that is pick...more >>

Data Page Size
Posted by Mohanjit at 8/21/2003 12:48:24 PM
I am looking for a sql query which can find current data page size of a given table. Any help will be greatly appreciated -Mohanjit ...more >>

how to install SQLServer service pack 3?
Posted by kathy at 8/21/2003 12:21:00 PM
I want to install MSDE service pack 3 by using: setup.exe INSTANCENAME="MYSERVER1" SAPWD="pass" but I got wrong instance name error. How to do that?...more >>

how to check SQLServer service pack version?
Posted by kathy at 8/21/2003 12:10:03 PM
how to check which SQLServer service pack version used in each instance of SQLServer database? for example, how can I get which service pack used for SQLSERVER1,SQLSERVER2 instances that my computer installed....more >>

Where/when to fill an empty field ?
Posted by Tim Conner at 8/21/2003 11:28:11 AM
I have a table in which one of the fields has a value calculated based on an stored procedure. This value has to be left blank by the application and filled by the database in any way. The way I found to do this is to create a trigger for insert, in which this value is filled by issuing a...more >>

??? Domain Error Occurred ???
Posted by Scott Archibald at 8/21/2003 10:51:20 AM
I am running a query that takes the cross product of a table against itself and uses some trigonometry functions to determine the distance between all the values. The cross product works but when I introduce the trig function only part of the result set comes back. No error is reported o...more >>

GMTime equivalent in SQL
Posted by Waldy at 8/21/2003 10:47:33 AM
Hi there, is there an equvalent function in SQL Server like the C GMTime to convert the numbers of seconds since 01/01/1970 to a datetime value? ...more >>

Updating Stored Procedure
Posted by Balaji at 8/21/2003 10:35:54 AM
Hi Is there any way when I alter a stored procedure it should automatically updated the stored procedure in different database. Thanks Balaji ...more >>

Import CSV to table Part 2
Posted by Rog at 8/21/2003 9:45:48 AM
How do you configure BULK INSERT to ignore the first line of our CSV file. The first line contains column information and not the data. This is what we have so far... BULK INSERT Northwind.dbo. [ACSTest] FROM 'c:\test.csv' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) Th...more >>

Sending the inserted row to a printer....as and when inserting or updating?
Posted by Naga at 8/21/2003 9:40:05 AM
Hi all, I want to print the values inserted or update in a Table in to a green bar printer. This is like a log . How do I achieve this. Any Idea please advice me. Thanks Naveen ...more >>

declare optional params in a stored procedure
Posted by jt at 8/21/2003 9:20:28 AM
is there a way to declare an optional parameter in a stored procedure (SQL Server 2000)? i have a lot of procedures that i use repeatedly throughout our system, but they do not always require the same param values. rather than sending null values to the procedure i thought it would be ea...more >>

stored procs and temp tables
Posted by james_kelleher NO[at]SPAM nhp.org at 8/21/2003 9:17:06 AM
In an effort to facilitate code reuse, I have created a stored proc that creates a temp table. According to SQL Server documentation, this table "is deleted when you disconnect." My experience is that a temp table is deleted BEFORE I disconnect. I cannot even reference one immediately after ...more >>

SQL table, text file and upload - HELP ME
Posted by Robert K at 8/21/2003 9:00:22 AM
Hello, I have problem: My *.txt file is like it: " 12345612345678123 abcdefabcdefghabc " etc. i want upload data into table (for example TEST) i want to sql read this file and automatically upload to table.(as job for example) but i have 3 columns and i dont know how to separate this...more >>

To normalize or not
Posted by topdog at 8/21/2003 8:13:59 AM
I have a database that has repeated measures. PatientID, BPat5mins, BPat10mins, BPat15mins,...............BPat30mins. I am telling my co-worker that instead the table design should be PatientID, BP, TimeInterval My co-worker is telling me that the first way allows for easier grouping and...more >>

arrays in tsql ?
Posted by jerome at 8/21/2003 7:52:22 AM
Hi, is it possible to declare an array variable in tsql ? something lite Myvar1(100) and Myvar2(10,100). If, not, any workarounds to handle many variables ? (I've tried to write the code in a VB-script, but it was to slow). /J...more >>

Repeating records
Posted by BORR at 8/21/2003 6:05:55 AM
Hi, can somone please help me with this problem. I'm parsing a text file that holds call information. I've dumped the text file into a table and parsed it the best that I know how. However, I'm having a problem getting the date on every call record because the date will only appear once a...more >>

query problem, #temptable
Posted by u489685058 NO[at]SPAM spawnkill.ip-mobilphone.net at 8/21/2003 5:34:34 AM
studentID,# of exams, # of passGrades, exam, result Database is designed to return all above but it prints the exam and result part only if result < 50. select studentID,# of exams, # of passGrades, exam, result from A, B, C where C.result < 50 resulted in nothing to return if there are ...more >>

Getting connection info
Posted by Stephen J Bement at 8/21/2003 4:54:12 AM
How do you get the loginname and hostname used during a proc? Semper Fi, Red ...more >>

Unicode Replace() function
Posted by A_X_L_X at 8/21/2003 2:59:27 AM
Hello, I need an equivalent of REPLACE() function for NVARCHAR characters. Current REPLACE returns VARCHAR. I am using SQL Server 2000. Example: REPLACE('Some long non-english string','non-english string','tail') should return N'Some long tail'. Instead, it returns 'Some long ????'. ...more >>

Naming
Posted by Phil at 8/21/2003 2:49:54 AM
Is there a standard or recognised / adopted document for naming conventions for SQL Server Objects...more >>


DevelopmentNow Blog