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 2005 > threads for sunday june 26

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

Create DISTINCT delimited list?
Posted by Ali at 6/26/2005 11:25:24 PM
I'm using the following code to create a comma delimited list of values. It works fine, but I need it to return only DISTINCT values and am having trouble with the syntax. Any ideas? DECLARE @myList varchar(1000) SELECT @myList = COALESCE(@myList+',' , ' ') + CAST(ColID AS varchar(20)) FRO...more >>


Error While Updating a Temp Table - Cannot resolve collation confl
Posted by Sevugan at 6/26/2005 10:55:01 PM
Hi, I am passing the name of a temporary table(#TempTable1) to a stored procedure. I am creating another temporary table inside this stored procedure (#TempTable2). I am executing an update statement by joining these 2 temporary tables in this stored procedure. UPDATE A SET A.Field...more >>

SQL2k record paging
Posted by Eddie at 6/26/2005 10:22:28 PM
I found this article at http://www.aspfaq.com/show.asp?id=2120 which shows different ways to page records from SQL Server 2k. I chose the stored procedure method call "Stored Procedure Rowcount". Here is the sql code and it works great with their example. The SampleCDs table is set up so that ...more >>

QA works on one machine, not on other?
Posted by Brett at 6/26/2005 10:04:34 PM
I just installed QA on an XP machine. I keep getting a login failure message when trying to connect with an SQL Server. From another XP machine, QA works fine with the same exact login. Is there something else I need to setup or any reason why the login would keep failing on the new setup? ...more >>

SQL2K record paging?
Posted by Ed Burns at 6/26/2005 6:49:13 PM
I found this article at http://www.aspfaq.com/show.asp?id=2120 which shows different ways to page records from SQL Server 2k. I chose the stored procedure method call "Stored Procedure Rowcount". Here is the sql code and it works great with their example. The SampleCDs table is set up so th...more >>

formula in column & dealing with nulls
Posted by David Shorthouse at 6/26/2005 3:42:20 PM
Hey folks, I'm trying to make a formula in a table's column to add the contents of 3 smallint columns. Nulls in the three columns don't permit the formula to add the contents. Is there any way to adjust the column's formula to treat nulls as zero such that the formula will work? Than...more >>

Q: LIKE @Search1 + '%' in SP seems not to work in some cases?
Posted by marco.prischmann NO[at]SPAM gmx.de at 6/26/2005 2:51:04 PM
Hi, in a SP I use ...LIKE @Search1 + '%' It works in a small query within the SP. But it seems not to work in a more complex query. Here's the small one that works fine with the SP: CREATE PROCEDURE dbo.mySPsName(@Search1 char(100)) AS SET NOCOUNT ON CREATE TABLE #Results (ID int) ...more >>

Triggers Disabling
Posted by Robert Jackson at 6/26/2005 2:15:01 PM
Hi, I'm having a problem with triggers suddenly becoming disabled. I look at the server on minute and they're enable in working. 5 minutes later they're disabled. There is no code that disables the triggers. Is there any other possibilities to solve this? ...more >>



Syntax Help
Posted by Troy Jerkins at 6/26/2005 2:04:57 PM
I have a variable that I want to pass to a SELECT statement, but need to check and handle NULL values. The statement below declares @notify_param which is going to be passed as a column name. DECLARE @notify_param varchar(15) SET @notify_param = 'ORDER_CLOSE' select u.Uid, u.FName + ' ' ...more >>

Store locator type problem with vb .net and SS 2000
Posted by Sandy at 6/26/2005 12:35:03 PM
Hello - I am trying to do something similar to a store locator and I am getting the following error: System.Data.SqlClient.SqlException: Error converting data type nvarchar to float. I have the following tables: tblZipCode ID int NULL , UserID int NULL , ListType int NULL , ...more >>

Getting the maximum out the int (identitiy) datatype
Posted by Arjen at 6/26/2005 12:31:17 PM
Hi, Quote: "Use the int data type to store numbers in the range from -2,147,483,648 through 2,147,483,647 only (requires 4 bytes of storage per value)." If I use the int datatype as identity and set identity seed to -2,147,483,648 (increment + 1). Then I get the maximum range? Or not? ......more >>

Select statement that excludes from a table
Posted by Kevin Buchanan at 6/26/2005 10:31:02 AM
How do you write a select statement that pulls all records from a table - unless there is a match from another table? To be more specific: I am writing all events from the EventLog into a table called "Events". I want to track all events, but in some reports, I don't want all the events l...more >>

osql Unicode behavior
Posted by Alan Samet at 6/26/2005 9:55:36 AM
I'd bet a dollar Erland knows the answer to this one... I've seen this issue on usenet, but I can't seem to alleviate it. After my database script grew past about 3000 lines, I decided to start breaking it up into smaller pieces and just have python call my steps for me. The scripts execute...more >>

Import/Export
Posted by Ed at 6/26/2005 5:43:02 AM
Hi, I just find out that when I use Import/Export wizard to copy tables between databases/servers, the Identity column and Primary Key always cannot be transfered even I specific to transter the Primary Key. Is that always a issue with identity column? Thanks Ed...more >>

schedule stored procedure & replace existing table
Posted by David Shorthouse at 6/26/2005 12:19:13 AM
Hello folks, I just migrated from Access, which had a few options I can't live without. One of these was that I had a make-table query to replace an existing table. I have this same stored procedure in SQL Server now but when I attempt to run it, I receive the notice "There is already a...more >>

Datetime conversion question
Posted by Ilin Star via SQLMonster.com at 6/26/2005 12:00:00 AM
I have UpdateTime column (datetime data type) in the table t1. In the table t2 I have ResetTime column (char data type) when time is written like 11:00. I need to create query that will select records where UpdateTime is in between ResetTime minus 45 minutes and ResetTime I was able to create...more >>

Update Script question
Posted by Agnes at 6/26/2005 12:00:00 AM
I want to update a field 'recstatus' , The following statment is invalid, Does anyone can tell me how to write ? Thanks UPDATE apinvinfo set RECSTATUS = iif(printver=0,'UP/','PT/')+IIF(CLOSESW=1,'CL/','UC/')+ IIF(netbaseamt=0,'FS/','US/')+IIF(postsw=1,'TA-1','') where valdisw = 1 ...more >>

Fieldname as variable
Posted by Shelby at 6/26/2005 12:00:00 AM
Hi, in my Stored Procedure, can I do something like that? ========================================== set @fieldname = "InvoiceAmt" select InvoiceCountry, @fieldname from invoicetbl GO ========================================== If not, is there anyway for the field name to be a varia...more >>


DevelopmentNow Blog