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 > december 2006 > threads for friday december 29

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

PIVOT
Posted by Nassa at 12/29/2006 10:46:38 PM
Hello Everyone, I have 3 tables: Telbook(Id:int,Name:char,address:char,comment:ntext,owneruserid:int), PK:id TelNumbers(telbookid:int,telno:char,telNotype:int,syscode:int),PK:syscode,F= =ADK:telNumbers.telbookid=3Dtelbook.id Teltypes(teltypes:char,fk:int),FK:telnumbers.telnotype=3Dteltypes...more >>

temp table name question
Posted by Keith G Hicks at 12/29/2006 6:21:40 PM
When I use the following in a stored procedure (sql 2k), I get the error that #temp1 already exists. I understand why. IF .. some condition SELECT c1, c2, c3 INTO #temp1 FROM Customers ELSE SELECT c1, c2, c3, c4, c5 INTO #temp1 FROM Customers I know I can get around this by creatin...more >>

does ms sql support two phase commit protocol
Posted by amoon.ljlj NO[at]SPAM gmail.com at 12/29/2006 3:08:17 PM
Hello , My question is: does ms sql support two phase commit protocol? and Why if no. How if yes. Thank you ...more >>

permissions of string executed within sproc
Posted by Richard Hayward at 12/29/2006 1:38:19 PM
Within a stored procedure I'm constructing a string and executing it. The technique I'm using is like this: CREATE PROCEDURE myTestProc @tablename varchar(20) AS DECLARE @sql_string varchar(500) SET @sql_string = 'SELECT * FROM '+@tablename EXEC(@sql_string) The actual ...more >>

SQL Query help
Posted by lara at 12/29/2006 12:34:53 PM
Hi, I got a Query DECLARE @EndDate DATETIME SET @EndDate = '20061211' --dec 11 DECLARE @tab TABLE(Emp_Id int , start_Date datetime, End_date datetime ) INSERT INTO @tab SELECT 100,NULL,null INSERT INTO @Tab SELECT 100, '20061210','20061212' -- dec 10 and Dec 12 INSERT INTO @tab SELECT 10...more >>

Loading statas next to Database after failed restore
Posted by gv at 12/29/2006 11:56:47 AM
Hi all, Using SQL 2000 with SP4 I have a job that restores a Database every day and usually runs fine, sometimes though it fails becuase the BAK file is corrupt. Will after it fails the database has a statas next to it that says "loading". Ok how do I get this out of loading state so I c...more >>

Error: Incorrect syntax near the keyword 'UNION'.
Posted by Emily at 12/29/2006 11:45:40 AM
Hi, The following syntax with a "UNION" doesn't work: INSERT INTO #PrintReconcilication ( ClientName, Method, Location, AccountName, ReportInstanceID, Status, ...more >>

Error: Incorrect syntax near the keyword 'UNION'.
Posted by Emily at 12/29/2006 11:43:21 AM
Hi, I've tried the following syntax with a "UNION" but it doesn't work: INSERT INTO #PrintReconcilication ( ClientName, Method, Location, AccountName, ReportInstanceID, St...more >>



INSTEAD trigger, primary key, multiple rows, INSERT/UPDATE paradigm
Posted by rpresser at 12/29/2006 11:08:11 AM
1. Primary keys must be unique. 2. One of the touted purposes of INSTEAD triggers is to let the classic "insert if new, update if exists" decision be done in the trigger, so that the calling logic can just do INSERT and not worry about it. For instance, see http://msdn2.microsoft.com/en-us/li...more >>

Using dataset from a stored procedure AS IF it were a table
Posted by Emily at 12/29/2006 10:55:06 AM
"GetPrintReceipts" is a stored procedure. Anyone can help me to correct the "EXEC" syntax error in the following: ----------------------------------------------------------------------------------------------------------------------- INSERT INTO #PrintReconcilication ( ClientName, Me...more >>

sql and web
Posted by JFB at 12/29/2006 10:20:05 AM
Hi All, I have an intranet app using asp.net. The app is getting popular and now is going over the internet for all sales people and external users. I'm using windows authentication for my login. The challenge is... How can I prevent a single record to be update twice? Means if two users brin...more >>

"EXEC" syntax for using stored procedure, and adding one column right after
Posted by Emily at 12/29/2006 9:49:38 AM
I have a SQL statement as follows: -- Insert into the temporary table the Pace data INSERT INTO #PrintReconcilication ( --AccountID, --PackageName, ClientName, Method, Location, AccountName, ReportInstanceID, Status, ScannedBy, TimeScanned, DistributionCommon...more >>

SQL Server 2000 foreign key constraints
Posted by martiningham NO[at]SPAM robertheath.co.uk at 12/29/2006 9:35:03 AM
I am working on an MS Access client application linked by ODBC to a SQL Server 2000 database. I have noticed that all foreign key constaints have been dropped on one table on the production database. Is there any way that foreign keys could be dropped by SQL Server without human intervention? ...more >>

Is update of structure part of transaction
Posted by hlop2002 NO[at]SPAM hotmail.com at 12/29/2006 7:05:43 AM
Hi, I would like to use ADODB.Connection - BeginTrans method as guard for update of database structure SQL Server 2000 and up. Example vb6 code Sub RunUpdate(c as ADODB.Connection) On Error GoTo ErrH c.BeginTrans c.Execute "drop procedure ...", ,adExecuteNoRecords + adCmdText c.Execut...more >>

Problem with service broker
Posted by Adi at 12/29/2006 6:49:40 AM
Hi all I'm having a problem with service broker. I started playing with it and created 2 databases that I try to exchange messages between them. The problem that I have is that some of the messages disappear. I'm sending the message, but it doesn't get to the queue that it should get int...more >>

Complex counting
Posted by Patrick at 12/29/2006 4:16:00 AM
I need to write a query to count up the amount of sales done by different sales persons. Each sale can be contributed by multiple sales reps, and the count need to be apportioned. If Status=Order, then count as 1, if REFUND, count as -1 e.g. invoiceID salesRepID Status Date 92812 ...more >>

Help me plz
Posted by Taha at 12/29/2006 3:53:04 AM
Hi all I Have Tow Table Like Table 1 Id , Total 1 , 10000 Table 2 Id , Items 1 , 400 1 , 300 1 ,200 2 , 490 what I need Table 3 like Id , Items , Total Reminder 1 , 400 , 600 1 , 300 , 300 1 , 200 , 100 Plz Help me Thanks ...more >>

Access system view in AUDIT_LOGIN event notification
Posted by Nitin Garg at 12/29/2006 3:00:40 AM
I am trying to use event notification functionality provided in SQL Server 2005 for AUDIT_LOGIN. The field provied by this are not sufficient for me so that i am trying to exatract extra information for each login from system view sys.dm_exec_connections. But when i do a select on this view in t...more >>

Want to access ( .MDB) files
Posted by Bhavin Chauhan at 12/29/2006 2:52:59 AM
Hi I'm a 'C' & c++ programmer but unfortunatly i have to write a applicaton in C who will access ( .MDB ) files. I don't know where to start..... I need to know which header file i have to use what are the function to open close write and retrieve. Please can you tell me where to...more >>

how to pass a special char to a stored procedure param
Posted by Nedim at 12/29/2006 2:13:00 AM
i have a stored procedure (in sql server 2005) made for retrieving paged and occasionaly filtered data. i'm using a construct SELECT * FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY ' + @col + ') AS RowRank FROM table ' + @filter + ') c WHERE RowRank >= ' + CONVERT(nvarchar(10), @start) + ' AND...more >>

Formatting Date related information in SQL Server 2000
Posted by Pradeep at 12/29/2006 12:35:00 AM
Hello, I am using SQL Server 2000 as a back end. I receive Excel files with some information and i import that information into SQL Server. Now I have a problem with one of the fields in the file.One user sends it in format 'MAY 2007' while another sends it as 'MAY 07'. I need to get the da...more >>


DevelopmentNow Blog