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
August 2008
all groups > sql server programming > september 2007 > threads for wednesday september 19

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

Multiple SUM, Multiple GROUP BY
Posted by John Doe at 9/19/2007 9:29:19 PM
Hi! I'm trying here to do a compilcated(?) SQL statement... The first step I did was this: I have table1: key description -------------------- 0 john 1 dani 2 joe then table2: amount key ---------------- 30 0 20 0 25 1...more >>


Get the column list of a dynamically contructed SQL select stateme
Posted by ydbn at 9/19/2007 7:16:02 PM
I need to get the column list string of dynamically generated SQL select statement. For example, I get input of a string 'select 1 as A, '234' as B, C from .......' and it will get 'A, B, C' ...more >>

q: on Union all
Posted by Ana at 9/19/2007 5:55:37 PM
Hi, I've the following query: SELECT SUM(dbo.CLAIMS.PAID AS COSTS, dbo.CLAIMS.TYPE_ID AS ID1 FROM dbo.CLAIMS GROUP BY dbo.CLAIMS.TYPE_ID UNION ALL SELECT SUM(dbo.CONTRACT.COSTE) AS SELLS, dbo.CLAIMS.TYPE_ID AS ID2 FROM dbo.CONTRACT GROUP BY dbo.CL...more >>

A tool to compare records in 2 tables
Posted by MittyKom at 9/19/2007 3:40:02 PM
Hi All Is there a tool that i can use to compare records in two tables. The table structures are the same and also there the tables have primary keys. All i want is, if there are records in table A that are different from records in tbale B, then list the PK for those records. I know it's p...more >>

Archiving sql server records
Posted by Jack at 9/19/2007 2:34:03 PM
Hi, I have sql server records that need to archived in archive tables in the same database. The rows are in five different tables. The archive should be such that those data could be restored at a future time. Is there any knowledge base or concept that will allow me to do so? Or do I have cr...more >>

Parsing columns from Cookies
Posted by Pasha at 9/19/2007 1:26:03 PM
Hi All, I am processing WebLogs and part of the task is extracting values from the cookies. The format of the cookie is similar to this: url=www.url.com;referrer=www.google.com;pcode=1234;testid=2334;abtestgroup=A etc. The order of values can be different for each record and the last ...more >>

Question
Posted by Emilio Vick at 9/19/2007 12:50:21 PM
Miguel I been reading your post Basically I need to insert a new record if there is no record with the given @id or update the record if one is found with the given @id. Its possible that you can send me the final chunk of code that resolve the issue. Thanks in Advance EggHeadCafe...more >>

Need explanation of "Restore Database" sample SQL code
Posted by Curious at 9/19/2007 10:42:13 AM
I found a piece of sample code about restoring a database: Assuming that the database backup file name is c:\backups\northwind\nwind.bak, the following command will restore the database to "nwind_new": RESTORE DATABASE nwind_new FROM DISK = 'c:\backups\northwind \nwind.bak' WITH MOVE 'northw...more >>



XQuery with variable in stored procedure not working
Posted by outatime at 9/19/2007 9:50:05 AM
I cannot get an update to work in a stored procedure. I have a column of type XML named ‘Approvals’. Here is a shortened standard entry in that column. <Approvals> <Approval BodyID="MCCH"> <ApprovedBy>jsmith</ApprovedBy> <OnBehalfOf>John Jones</OnBehalfOf> <App...more >>

Preventing 01/01/1900 when Updating
Posted by Marc at 9/19/2007 6:29:11 AM
Hello, I'm developing in ColdFusion for my front-end, using SQL Server as my data repository. I have multiple date fields that are populated yet, some aren't. Those that aren't, may never be however when I perform an update action using an SQL Update statement, for those that are NULL or not pop...more >>

INSERT INTO hangs up on first attempt in job, executes quickly on second in SQL 2005
Posted by at 9/19/2007 6:20:21 AM
I have a very absurd scenario that only happens in a job. A procedure that I execute in this job hangs up on the insert statement of the following scenario: --BULK INSERT FROM TXT FILE --TRUNCATE STAGE_TABLE --SELECT INTO STAGE_TABLE FROM BULK TABLE --TRUNCATE FINAL_TABLE insert into FIN...more >>

Using DDL trigger to trace db soruce modification
Posted by checcouno at 9/19/2007 6:08:03 AM
I need to trace all my db structure changes. To do this i've seen in the msdn the use of DDL Triggers. I've done this: USE MY_DB CREATE TABLE LOG_DBSOURCE (LOS_ID int identity(1,1), LOS_CURRENT_USER nvarchar(100), LOS_SPID int, ...more >>

Transactions and "Dirty Reads"
Posted by Monty at 9/19/2007 3:29:37 AM
[MSSQL 2000, ASP.Net 2005, VB.Net] Hi, I'm hoping someone can suggest the best way to tackle this problem: I have a "sales order" object which may contain multiple line items. When the sales order is saved, the cost of each line item is determined by a UDF (called GetAverageCost). GetAvera...more >>

Insert speed issue
Posted by pmozdzen NO[at]SPAM gmail.com at 9/19/2007 12:57:28 AM
Here is my situation: We have highly partitioned database with many child tables that go many levels deep. For example Table1 is related to Table2 which is related to table3 and so on. Table2 might have hundreds of records and others too. I have to make a copy of one record from Table1 and a...more >>

calculating number of rows added per week
Posted by luna at 9/19/2007 12:00:00 AM
Im trying to establish how many rows were done per week per year eg results would be week / rows 1 23 2 27 3 35 etc table has ID and a date been playing with datepart but didnt really get the results i was thinking of cheers mark tbh im sure ive done ...more >>

Job interview in 2 days, please help
Posted by nujcharee NO[at]SPAM googlemail.com at 9/19/2007 12:00:00 AM
Hi guys I dont know if I post this in the right group but I thought I give it a go. I will have an interview in 2 days and I so want to land this job. The job is database developer. It is a job for a public sector organisation so I think there are so many things they need to comply e.g infor...more >>

SQL Server client tools license
Posted by McGeeky at 9/19/2007 12:00:00 AM
Hi. We will be using a hosting company for our customer's SQL Server 2000 database. The customer has expressed interest in managing the database themselves. The hosting company says they don't supply the client tools. Therefore, how can the customer license just the SQL Server 2000 administr...more >>

Strange problem in execution of DTS Package
Posted by Rahul at 9/19/2007 12:00:00 AM
Friends, I have a very strange issue. When i execute a DTSPackage with less amount of data. its execute fine, But when i execute it with double amount of data and check form SQLProfiler, it take so many times, the conditions are : -lot of times execute msdb.dbo.sp_sqlagent_get_perf_count...more >>

Chained Views
Posted by randy.buchholz at 9/19/2007 12:00:00 AM
I'm developing an app that removes multiple values from a starting value in stages. The app is an assignment system that starts with the "annual work hours", subtracts "vacation hours", then "overhead", etc. I work with each subtotal and there are about six stages of results. I am using ...more >>


DevelopmentNow Blog