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 > june 2006 > threads for friday june 9

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

WHERE clause optimization
Posted by Sericinus hunter at 6/9/2006 8:09:40 PM
Consider the following WHERE clause: ...WHERE (Col = 1) OR (Col IN (SELECT OtherCol FROM OtherTable)) Would it be different performance-wise from the following: ...WHERE Col IN (SELECT 1 UNION SELECT OtherCol FROM OtherTable) Thank you....more >>


save results to multiple files
Posted by JR at 6/9/2006 2:58:37 PM
I have a table with hundreds of thousands of records. I don't want to get into why, however I need to take all this data and save it to file. Now I can do this fine with Query Analyzer saving to file, however every 15,000 records I need to continue writing to the "next" file. Is there a way t...more >>

Is it possible to make a HTTP Post in TSQL? (SQL Server 2000)
Posted by Tom at 6/9/2006 2:05:01 PM
I am new to TSQL and cannot find anything in my reference book or on the internet about how this can be done. If so, can you let me know how. Many thanks Tom...more >>

How to use getdate() and user_name() functions with Windows NT login
Posted by Randall Arnold at 6/9/2006 1:27:43 PM
I am connecting to my SQL Server 2000 database with a Windows NT security login. Several of my tables require a timestamp and user id for row added. I use getdate() for the former default and user_name() for the latter. This works great if I'm using any SQL logins-- however, neither of the f...more >>

Using break with nested cursors
Posted by vguddanti NO[at]SPAM gmail.com at 6/9/2006 12:46:00 PM
I wrote a stored proccedure with nested cursors. If one condition failed in the first child cursor, break that child fetch, and should go to the parent cursor and continue looping to next row. My problem is when a condition falis in CHILD 1, then the PARENT FETCH also exiting. It is not going ...more >>

backing up 2005 to something I can restore to 2000
Posted by PJ6 at 6/9/2006 12:31:38 PM
I have an exiting database which I'd rather not manually recreate that I'd like get a backup file from that I can restore to a 2000 database. Is this in principle possible? Paul ...more >>

replacing Apostrophe
Posted by Logger at 6/9/2006 12:07:02 PM
I’m trying to key the syntax for replacing the Apostrophe with double Apostrophe and update table. Example: Programmer’s with Programmer’’s Here code for finding occurrences: SELECT DEALNAME FROM DLWKTABLE20060609 where dealname like '%['']%' BUT how do I update: Update dlwktabl...more >>

create function
Posted by john doe at 6/9/2006 10:09:54 AM
I'd like to return a NULL value from a mssql function, but i can't get it to. here's my sample: CREATE FUNCTION dbo.FixVarChar (@val nvarchar(30) ) RETURNS nvarchar(30) AS BEGIN declare @retval as varchar (30) select @retval = case when len(@val)>0 then @val else null end return (nul...more >>



Add auto number field to view
Posted by JR at 6/9/2006 9:54:49 AM
I have a simple view something like "SELECT * from <table_name> order by field1,field2,field3 I have a program that needs to read these values in by the order I have ordered them in the database however it needs an incremental numeric value to do so. Is there any way to add to the view, a fiel...more >>

distributed transaction with loopback linked server
Posted by JohnC at 6/9/2006 9:25:01 AM
Folks, I am wondering if there is workaround for distributed transaction query in loopback linked server. Thanks ...more >>

Startup stored procedures
Posted by imss NO[at]SPAM netvision.net.il at 6/9/2006 9:23:50 AM
Hi all i need to write script that check if there is any 'Startup stored procedures ' , how i write it? Thanks ...more >>

Datetime problem
Posted by Levent Helvacioglu at 6/9/2006 9:11:02 AM
an existing application sends server an sql string like insert into dbo.test (c1, c2) values (1, '22.1.2006 10:10:10') where c1 is an int, and c2 is a datetime field. This command returns an error. Server: Msg 242, Level 16, State 3, Line 1 The conversion of a char data type to a datetime ...more >>

Primary Information
Posted by S Chapman at 6/9/2006 9:05:40 AM
Given a column id/name and table name/id I need to find out if the column is a primary key. I have checked all the SYS* tables and could not find the information I was after. Can you point me in the right direction please. Thanks. ...more >>

Return ADO recordset to worksheet
Posted by Terri at 6/9/2006 9:05:10 AM
Any help would be appreciated. I am trying to return a recordset to a worksheet using ADO. I want to go dsn-less. I confident that my recordset returns data, I've tested this in Access and can return records there. I am a new excel programmer. I am trying to use CopyFromRecordset to ret...more >>

how to convert varchar into datetime field
Posted by TG at 6/9/2006 8:44:58 AM
Hi! I have the following field: e.g this field is called admit 60124 varchar 255 (type length) I want to convert it to a date. e.g 20060124 How can I achieve this? I tried using update special set admit_date = convert(varchar(5),admit,101) Thank you! ...more >>

Cursor doesn't loop properly???
Posted by Tim::.. at 6/9/2006 7:42:01 AM
Can someone please tell me why this doesn't work??? I am trying to loop through a table and populate a column called LocalIDNumber with random numbers... But there must not be any duplicates! This runs perfectly but only populates the first record and not the other 5000 records in the data...more >>

use go on varriable
Posted by Ganesh at 6/9/2006 3:41:02 AM
Hi There, How can i use go on multiline statement, I would like to create job step which contains go in it. But i can not create. I try to use something like this EXEC sp_add_jobstep @job_name = N'Audit_Log Truncate', @step_name = N'AG Audit Log Truncate', @subsystem = N'TSQ...more >>

EXEC(@SQL) And Unicode Result Bug
Posted by Tris at 6/9/2006 3:28:01 AM
I've got a dynamic SQL query that is generated inside a SP, and is run using the EXEC (@SQL) or EXEC sp_executesql @SQL This has worked fine until now, where we are now using a database for unicode charachters to support Japanese language. All fixed code stored procedures return d...more >>

stop using dynamic sql
Posted by farshad at 6/9/2006 2:57:02 AM
Hi, The following stored procedure (SP) is using a dynamic sql to build the query. How can this be written using a standard sql. i.e. NOT dynamically being built. Initially I thought I can have something like the following query but it does not seem to be working for when the where caluse par...more >>

SQL use of processes.
Posted by Simon at 6/9/2006 2:01:02 AM
Had a look on the site but haven`t really found an answer so hope someone can point me in the right direction. Should the calling application kill a SQL process once it has finished. If not what are the implications in terms of the memory available to the server. Thanks Si ...more >>

how to write extended stored procedure to generate sequences.
Posted by Veeru at 6/9/2006 12:39:01 AM
Hi, I have one table called sequence_number with two columns Seq_name nvarchar(50) last_num bigint. I have one function, in that i am calling extended stored procedure. this XP has to return the next seq number based on the sequence name we have given. My intension is I have get the db co...more >>

SQLXML
Posted by Nikolami at 6/9/2006 12:01:32 AM
Is it possible to install SQLXML on Win 2003 with SQL 2000??? ...more >>

UDT, what's the point?
Posted by Micke 2.0 at 6/9/2006 12:00:00 AM
Sorry about the crosspost; not sure in which it belongs. I tried making a simple UDT comprising of a few integers that are closely related, and the user designed type seemed perfect (using visual studio 2005). Easily made and easily installed, and from T-SQL it works as expected. However...more >>

Compatibility level, SQL 2005
Posted by Morten Snedker at 6/9/2006 12:00:00 AM
In SQL Server 2005 it is possible to set a compatibility level. Prior to this server we were running SQL 2000. Wil still have one linked server running SQL 2000. What I'm confused about: what does this comp. level actually do? When is it an advantage - and when not? Regards /Snedker...more >>

No transaction is active
Posted by Morten Snedker at 6/9/2006 12:00:00 AM
I've google'd like a crazy, tried a lot of stuff, but still can't get it to work: When run on our old SQL 2000 it worked fine. Now, running SQL 2005 it doesn't: An UPDATE-trigger on a table calls a stored procedure that selects data and send them to a linked server. 1. When running the...more >>

Number of days in previous quarter?
Posted by Jan Doggen at 6/9/2006 12:00:00 AM
Hello I need to calculate the number of days in the previous quarter relative to 'today'. I thought it would be as simple as the number of days between today and one quarter earlier: datediff(dd,dateadd(qq,-1,getdate()),getdate()) but that gives 92 (it should be 31+28+31=90 today). Subtra...more >>

dll & Web Service in VB.Net 2005 Stored Procedure
Posted by James Wong at 6/9/2006 12:00:00 AM
Hi, I am writing a vb.net2005 program that needs to create a stored procedure with SqlServerProject Template. Now, I have two questions for this stored procedure. 1) How can I import and execute the .dll in this Stored Procedures? 2) How can I connect the Web Service and get the result in ...more >>

What is wrong with this code?
Posted by Adrian at 6/9/2006 12:00:00 AM
Coud someone please tell me what is wrong at the line marked xxxxxx ? Adrian. using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Data.SqlClient; namespace WindowsApplication2 { public ...more >>

SQL-92 varchar maxlength
Posted by Svenne at 6/9/2006 12:00:00 AM
Hi! I want to design a database that is compatible with SQL-92 standard. Does anybody know what the SQL-92 standard says about the maximal length of the varchar datatype? Thanx in advance /Svenne ...more >>

Update statment problem
Posted by Agnes at 6/9/2006 12:00:00 AM
(1)select * from tmp_gltransaction where tmp_gltransaction.reportid = 'MGR-6530234110' (2)UPDATE tmp_gltransaction SET acctname = (select acctname from chartofaccount where chartofaccount.acctcode = tmp_gltransaction.acctcode and tmp_gltransaction.reportid = 'MGR-6530234110') For Sta...more >>


DevelopmentNow Blog