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

how to audit the sql tables
Posted by mohan_doss at 9/21/2007 11:34:00 PM
I want to check when and which time the tables are altered by users and whether they are directly altered in the table or by using the query analyser. tell option to audit the above information ...more >>


Error when I parse TSQL
Posted by Cabal75 at 9/21/2007 8:03:19 PM
Everytime I try to parse SQL statement in SSMS I receive the following error: ..Net SqlClient Data Provider: Msg 0, Level 11, State 0, Line 0 A severe error occurred on the current command. The results, if any, should be discarded. This happens to everyone in the company. It happens while c...more >>

Simple Q:
Posted by Ana at 9/21/2007 7:03:18 PM
Hi, When joining two queries in one, I understand that the format is as follows: SELECT * FROM (<first query here>) as A JOIN (<second query here>) as B ON A.ID = B.ID What would be the format when joining more then 2 queries? I'm having a problem with the ON syntax when a third (...more >>

Need help with a summary query
Posted by Dave at 9/21/2007 5:36:54 PM
I'm having difficulty forming a query for data that is laid out like this with duplicate IPs: LoginDate, IPAddress, PortNumber, NumberOfLogins 2007-09-06 00:00:00.000 166.121.36.232 1863 629 2007-09-06 00:00:00.000 166.121.36.232 5222 629 2007-09-06 00:00:00.000 166.121.36.232 5051 629 2007-...more >>

sp_helpfile no work with sp_executesql
Posted by Jay at 9/21/2007 4:34:23 PM
SQL Server 2000 I have embeded a 'use <db>' statement in dynamic sql many times for different commands that require a current database context. However, this time it errors: --- clip --- USE tempdb DECLARE @DB SYSNAME DECLARE @SQL NVARCHAR(255) SET @DB='[msdb]' SET @SQL = 'use '...more >>

sql select - need to pull back job with all keywords
Posted by philipdowling NO[at]SPAM gmail.com at 9/21/2007 4:14:05 PM
Hi All Total newbie here so apologies in advance for silly question. I am working with a mysql database. In this database I have 2 tables (well more than that but thats not important), these being; "tbl_jobs" and "tbl_keywords". Each job has one to many keywords associated. Each job has a ...more >>

Simple trigger help
Posted by Matt Williamson at 9/21/2007 3:35:39 PM
Let me preface this by saying this is my first time ever trying to use a trigger. I'm trying to get one table to add data to a second table automatically when a certain column is inserted or updated. CREATE TABLE [porttest] ( [id] [uniqueidentifier] NOT NULL , [portcode] [varchar] (16) CO...more >>

Exception error from trigger on Great Plains table
Posted by GTK at 9/21/2007 2:20:30 PM
I've added an AFTER UPDATE trigger to the RM00101 table (customer master) in a Great Plains 8.0 SQL Server 2000 DB. Upon a change to any- of-21 fields (separated by "or"s), the trigger assigns field values to variables, constructs an update query, and executes the query on a table in a linked SQ...more >>



Create new record with multiple rows of data
Posted by bcap at 9/21/2007 1:14:02 PM
Hello, I am looking for some help/advice on how to add a new record that will need to insert more than one row at a time in another table. I need to take an EventID from one table as it is created, and have the EventID be also inserted into another table where I need three other rows crea...more >>

Table error: Object ID XXXXXX
Posted by Melih at 9/21/2007 12:58:00 PM
Hi All, How can I solve this issue? DBCC CHECKDB; GO result: Server: Msg 8934, Level 16, State 3, Line 1 Table error: Object ID 53575229, index ID 1. The high key value on page (1:193625) (level 0) is not less than the low key value in the parent (0:1), slot 0 of the next page (1:269...more >>

looking for easy way to run the same code against multiple databases
Posted by meyarm NO[at]SPAM hotmail.com at 9/21/2007 12:48:43 PM
Trying to run a bunch of code against a specific db based on a characteristic of a field in a driver table.... Sort of like this... If 1,dbo.drivertable.fld = 100 then use [A] run codeblockA else if 1.dbo.drivertable.fld = 200 then use [B] run codeblockA else use [...more >>

Hold lock on entire table for testing
Posted by David W at 9/21/2007 12:45:15 PM
How can I hold open a table lock or many page locks? I want to test some failure scenarios. Can I do this with a cursor somehow. Thanks. ...more >>

Group by question
Posted by Andy at 9/21/2007 12:38:03 PM
It's late on Friday and I need help. Here is my data below Table A Trans# Customer SalesPerson 1 ABC John Doe 1 ABC Jane Doe 2 XYZ John Doe Table B Trans# Customer ...more >>

BCP noob needs to output several tables to a text file
Posted by Eric Bragas at 9/21/2007 11:42:46 AM
Hi everybody, I'm new to BCP and assume it's the best way to accomplish my task, but please let me know if there's a better way. My task is to to export the contents of four different tables into one solitary text file. I'm calling BCP from a stored procedure with the following SQL, which ...more >>

nested stored procedure
Posted by sweetpotatop NO[at]SPAM yahoo.com at 9/21/2007 10:02:11 AM
Hi, I want to create a stored procedure which will call another procedure. Since the nested sp will record 2 record sets, I wonder how the outer sp be able to read the 2 returned recrodset. e.g. Outer sp call inner sp retrieve 1st recordset retrieve 2nd recordset ... Please...more >>

Select Into Problem.. Records Always Inserted at the Top
Posted by PavanR at 9/21/2007 7:34:03 AM
Friends, Take a look at the Code Below : drop table t5 go Select * into T5 from (Select * from T1) a Insert Into T5 (f1,f2) (select top 2 f1,f2 from T2 ) The above code from a T-SQL always inserts Records from T2 at the TOP of T5.. have also tried dividing Select Into and Insert Into i...more >>

Difference between "DELETE FROM [TableName]" and "TRUNCATE TABLE [TableName]"
Posted by Curious at 9/21/2007 7:30:47 AM
Seems that either statement is used to remove all of the records from a table. Is "TRUNCATE" faster than "DELETE FROM"? ...more >>

Select Into Problem.. Records Always Inserted at the Top
Posted by pavancode NO[at]SPAM gmail.com at 9/21/2007 7:17:03 AM
Take a look at the following T-SQL Code : drop table t5 go select * into T5 from (Select * from T1) a Insert Into T5 (f1,f2) (select top 2 f1,f2 from T2 ) select * from t5 go The problem is that Records from T2 are always inserted in T5 at the beginning/top of the records.. Only If we ha...more >>

DBCC DBREINDEX
Posted by Melih at 9/21/2007 6:38:02 AM
Hi All, How can I solve this issue? DBCC CHECKDB; GO Result: DBCC results for 'AgentsStateChanges'. There are 2422697 rows in 46484 pages for object 'AgentsStateChanges'. CHECKDB found 0 allocation errors and 92 consistency errors in table 'AgentsStateChanges' (object ID 2025058250). D...more >>

Numeric data retrieve trim by thousand
Posted by angkew NO[at]SPAM gmail.com at 9/21/2007 4:04:14 AM
I have weird problem with SQL Server recently. When I save a data into Numeric field, if the figure is 1,000, it save correctly. But when I retrieve it, it will become 1. If save 10,000, it will become 10 when retrieve. My server is Windows Server 2003, SQL Server 2000.... The problem only...more >>

Any one to help me..........
Posted by Bpk. Adi Wira Kusuma at 9/21/2007 12:00:00 AM
UPDATE TTEMP_BC SET SISA_DTG = (SELECT TOP 1 SISA_DTG FROM V_CR_STATUS WHERE FCIDNUMBER = TTEMP_BC.FCIDNUMBER AND FCTIME = TTEMP_BC.FCTIME AND SISA_DTG < 1 ORDER BY SISA_DTG), ID_DTG = (SELECT TOP 1 IDABSEN FROM V_CR_STATUS ...more >>

FileStorage question
Posted by Jure Bogataj at 9/21/2007 12:00:00 AM
Hello! Don't know if this is the right news group (could someone direct me into some other NG, if not right), but here is the question: We process and store a lot of small scanned TIFF images (>20.000.000 per year; small portion gets deleted during the year), ranging from 25KB to 10MB. We're ...more >>

Releasing SqlDependency
Posted by at 9/21/2007 12:00:00 AM
Hello everybody, Can someone explain me how I can release a created sql dependency from my C# app ? The problem I am having is that I am creating an sqldependency when a user displays certain information on screen. However when the user changes his view of the data I want to: 1 - Release th...more >>


DevelopmentNow Blog