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

performance issue
Posted by shanky at 6/29/2007 7:34:00 PM
I have one performance problem.... I am using follwing query to get some data back from sql server 2000... select @Rec_Cnt = count(Customer_Id) FROM products with (nolock) WHERE product1 like COALESCE(@product1, product1) and product2 like COALESCE(@product2, product2) and product3...more >>


Instead of Trigger
Posted by shahabgerami NO[at]SPAM gmail.com at 6/29/2007 6:43:50 PM
Hi Is there a way to get notified that a table is modifyed without adding trigger to to a table. The software vendor warrant will not permit us to add trigger, but we have access to master tables and msdb. We need to query the table when anything changes in the table. There is no field in the t...more >>

WHERE / IN Syntax
Posted by Rene at 6/29/2007 6:18:19 PM
Below are two update queries. One of the queries uses the *IN* keyword to figure out what to update and the other one does not: -------------------------------------------------- UPDATE SomeTable SET SomeColumn = 'abc' WHERE AnotherColumn = (SELECT XColumn FROM XTable) UPDATE SomeTable...more >>

Notifications
Posted by CLM at 6/29/2007 4:54:01 PM
I am wanting to script sp_add_notification in SS 2000 where you tie an operator to an alert. But I don't want to run it if the notification already exists. I have found where the alerts exist (msdb.dbo.sysalers), but I cannot find where the notifications exist. Can anybody tell me where...more >>

single update statement multiple values multiple conditions
Posted by scarboroughd NO[at]SPAM gmail.com at 6/29/2007 4:52:27 PM
I'm not even sure my subject is accurate, but here goes. Is it possible to combine multiple update queries into 1 statement? As in: 'Change salary to $65000 where currently $60000 and change to $80000 where currently $75000' My SQL attempts, chron. desc.: UPDATE tblEmp SET fldSal = 6...more >>

performance
Posted by Awi Ktir at 6/29/2007 4:28:34 PM
Hi. We have a performance DB .. big one with enough records to test performace of an OLTP db. sometimes procedure executions fly and sometimes they just don't execute .. the difference I am talking about is between 120ms 1 or more minuts for exactly the same proc. the server has 12 GB of m...more >>

Passing variable for"IN" clause
Posted by JimP at 6/29/2007 3:54:37 PM
I can do this in VBA, but not sure how to do it in T-SQL I would like to pass a series of comma separated values in a variable into the "IN" clause of a SELECT statement for a stored procedure. e.g. @VarName 'string containing comma separated values i.e. "5,9,20" SELECT ProductName F...more >>

trigger to run a perl script?
Posted by hmchkus at 6/29/2007 3:39:27 PM
Hi, I want to monitor add/update row in a table, I assume use trigger... Then I want to launch a console perl script to do something. How can I make a trigger to launch a perl script? This is on SQL2005. A example will be great. Thanks...more >>



DATEFIRST
Posted by someone NO[at]SPAM js.com at 6/29/2007 3:29:06 PM
Hi, I want to set monday as teh first day of the week, how to make it global to all database? Thanks. SET DATEFIRST 1 ...more >>

Context Switching
Posted by CLM at 6/29/2007 3:16:06 PM
I've got a 2000 SP4 server that has context switching over 25,000 day and night. Disk i/o is clearly very overburdened on this server as well. I'm not seeing memory problems though. Also, lightweight pooling is not turned on this server since the cpu is not that busy (way less than 80%). ...more >>

Selecting only one example from a non-distinct set
Posted by Leonard Chung at 6/29/2007 3:16:01 PM
I've been wracking my brain on this one and don't have an elegant solution to this. I have a problem in which I'm inserting into a target table which has different PK than the source table. If there's a duplicate of the target PK, I want to only insert one of the source table rows. For exam...more >>

Trigger containing EXEC sProc runs the sProc Asynch
Posted by dNagel at 6/29/2007 12:33:29 PM
Is there any way to obtain the result and output parameters from a call to an SP inside of a trigger? What I'm seeing is that the SP gets called just fine, but is executing out of process so the trigger continues on its merry way and never gets a value set in the output variables from the ...more >>

Local database server
Posted by Curious at 6/29/2007 12:28:53 PM
I've got a new computer. I want to set up a local database server and use the name of my machine, "TOSHIBA-USER", as the name of the database server. However, I see in Enterprise Manager that the default name of the local database server is "(Local)(Windows NT)". How can I get the server rena...more >>

Delete / update a record in sysservers table in the master database
Posted by Curious at 6/29/2007 11:29:20 AM
I've inserted a record into the sysservers table by executing the stored procedure, "sp_addlinkedserver". Then I saw that the record contained incorrect data in several fields. Therefore, I want to delete the record and start over. However, it doesn't allow me to delete the record. When I ran...more >>

Simple help I think...
Posted by stephen123 NO[at]SPAM redmango.demon.co.uk at 6/29/2007 11:12:23 AM
I have a table with two columns: DistrictNumber and MapNumber. The are many maps per district and there are a few maps that are in multiple districts. I am trying to create a query that will give me a list, sorted numerically, by map number, that will show the districts that the map is in. Somet...more >>

Any way to select all fields except 1?
Posted by Ken at 6/29/2007 9:50:01 AM
Is there a way to select all fields from a table except one without specifing every field? Example: Select U.*, -U.Birthday (psuedo code) From Users U Where FirstName = 'Bill' Or could I select it into a Cursor or something and then slice off the fields I don't wan...more >>

Help Create Trigger
Posted by cweyland NO[at]SPAM gmail.com at 6/29/2007 9:26:13 AM
Can someone please help me? I need to create a trigger to update between two database on the same sql server. Database 1 name is emdb. Table is BranchLoanNumber. Column: org_code, next_number Database 2 name is LoanNumbers. Table is LoanNumbers. Column: BranchID, CurrentLoanNumber. ...more >>

Encryption
Posted by Ed at 6/29/2007 8:44:01 AM
Hi, Is there any way I can encrypt a column that I need when it is saved into a database or during the process in Integration Services? Thanks Ed...more >>

How to use Trace Flag 1204
Posted by Leon Shargorodsky at 6/29/2007 8:28:05 AM
SQL 2000 Enterprise SP4 1. Can I add -T1204 to my startup params? If yes, how much load does it put on a server? Is it resource-consuming? 2. After I add 1204 trace flag, how do I check the output? How do I check deadlocks and victims specifically? Thank you in advance, Leon...more >>

Purge a huge table when a background process continuously inserts records into the table...
Posted by Curious at 6/29/2007 8:23:57 AM
I have a huge table, EventLog, that contains 52,000,000 records. I run the following purging routine to purge the table: SET ROWCOUNT 10000 WHILE (1 = 1) BEGIN DELETE el FROM EventLog AS el WHERE (el.ReportInstanceID IS NULL AND el.EventTime < DateAdd (Week, -@days, GetDate()))-- 2 weeks...more >>

Set Clustered Index Key
Posted by Nick at 6/29/2007 7:42:38 AM
How to set clustered index key by using SQL command? ...more >>

transaction log
Posted by David at 6/29/2007 7:30:04 AM
I need to update millions of records and I am affraid that when I will do this my file size for transaction log will fill up my drive. Is there any way I can stop writing transaction log during my update. I tried following statement but when i updated about 10,000 records my log file grow...more >>

Error after bringing stored procedure from SQL2K to SQL2K5
Posted by cleech at 6/29/2007 7:25:49 AM
Cannot add rows to sysdepends for the current object because it depends on the missing object 'executesql'. The object will still be created. Hello all: I get the above error message when I try to run the following stored procedure in SQL2K5. It seems that "executesql " does not work in SQL...more >>

growing database
Posted by rodchar at 6/29/2007 6:38:01 AM
hey all, what can i do to make sure my database is in tip top shape. to use a common windows analogy, is there a defrag and cleanup diskspace for sql server? thanks, rodchar...more >>

Different trace stats for same statement in SQL Profiler and Server Trace in QA
Posted by JimLad at 6/29/2007 4:21:00 AM
Hi, S2K question. I'm very confused. I have a FOR XML EXPLICIT statement that I looked at in Profiler and the Server Trace in QA. They gave very different results. Profiler: Event Class TextData SQL:BatchCompleted select 1 as TAG,0 as parent,_Q1.C0_member_statuses_id ... order by 3,4...more >>

Inefficient join?
Posted by Mark at 6/29/2007 2:20:02 AM
Hi there all I'm trying to produce a revenue report with detailed description - the description can be up to 5 lines held individually in a table called costdesc current code uses 5 left joins on costdesc question is whether there is a better way of doing this */-----------Current Cod...more >>

converting Stored Procedure to view
Posted by Sugandh Jain at 6/29/2007 12:00:00 AM
Hi, I have a stored Procedure, which has a several different queries to fetch some data. The data from different queries is added to a temp table, and at last all the rows from the temp table is sent to a c#.net 2.0 windows forms application. We are using SQL Server 2005. Now, I want to ...more >>

Date and Now()
Posted by sam at 6/29/2007 12:00:00 AM
In SQL what is the equivalent of a VB Now() TIA Sam ...more >>

db version control
Posted by cbtechlists NO[at]SPAM gmail.com at 6/29/2007 12:00:00 AM
How do you handle db version control with your team (changes to procs, views, tables, UDFs, etc)? What does your process look like? ...more >>

ADO.NET connect fails after some hours (cannot get connection from pool)
Posted by Rene at 6/29/2007 12:00:00 AM
Hi, We have a weird problem. We have our application running at about 100 clients, and at one customer suddenly some clients cannot connect anymore to the SQL server. This customer is using VPN and ISA and about 20 clients, and since 4 days ago we have these problems. Our client conne...more >>

Is it possible to create a custom SQL session function/variable
Posted by GMG at 6/29/2007 12:00:00 AM
To avoid having to pass this user specific ID via a parameter in the stored procedure, is it possible to create your own function like (like suser_sid()) or variable (like @@SPID) ? This value would be passed from a Web Service (asp.net 2.0) in the connection string or something and could be r...more >>


DevelopmentNow Blog