Viewing 15 posts - 3,751 through 3,765 (of 4,085 total)
The first error is probably caused by using an old version of dtexec. This will happen if you have both the SQL 2000 and SQL 2005 client tools installed...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 22, 2011 at 10:04 am
Stephen_W_Dodd (4/22/2011)
UPDATE table SET dtField = NULL WHERE dtField = 0
or maybe
UPDATE table SET dtField = NULL WHERE dtField = 0 Or dtField = '' ?
Remember dtField represents a...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 22, 2011 at 7:22 am
You could also try the undocumented stored procedure sp_msforeachtable.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 14, 2011 at 11:54 am
You have a couple of choices. In this case, a CROSS APPLY is probably going to perform best, but you may find that a CTE with ROW_NUMBER() will perform...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 11, 2011 at 12:56 pm
First, you have to remember that SQL is optimized for set-based operations while the language that you are translating from is most likely primarily a procedural language. Translating directly...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 8, 2011 at 2:10 pm
From books online
User-defined functions cannot be used to perform actions that modify the database state.
The datatype returned by a function is part of the database state, so you can't write...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 7, 2011 at 9:28 am
You're probably better off doing this in the presentation layer rather than in T-SQL. For instance, this is easy to do in SSRS by specifying the visibility property of...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 23, 2011 at 9:49 am
opc.three (3/17/2011)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 17, 2011 at 2:36 pm
David Burrows (3/17/2011)
Try this
LIKE '%rate[!"'',.:;? ]%'You can add additional chars between [] but check LIKE and PATINDEX on BOL (Books Online) for special chars and how to ESCAPE them.
You are...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 17, 2011 at 12:23 pm
The problem is that you are using absolute paths on the original column when you should be using relative paths on the derived columns.
SELECT stores.detail.value('(StoreName)[1]', 'varchar(50)') AS store_name
...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 16, 2011 at 10:15 am
jason-772533 (3/14/2011)
Hi Drew, Therein lies a small problem. I'm using a 2000 server, so can't use ROW_NUMBER as it's 2005 syntax!
There is a separate forum for SQL 7.0/2000...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 14, 2011 at 9:57 am
You'll probably want to use the ROW_NUMBER() partitioned by the Category for determining the columns. Before pivoting you'll have
A Aardvark 1
A ...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 14, 2011 at 9:28 am
I'm not sure about other tools, but I've found that for creating complex XML structures using T-SQL, you're better off using FOR XML EXPLICIT instead of any of the other...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 11, 2011 at 2:48 pm
SELECT Convert(varchar(25), Max(dt), 100)
FROM #Temp
WHERE DateDiff(Month, dt, Getdate()) BETWEEN 1 AND 2
GROUP BY DateDiff(Month, dt, Getdate())
ORDER BY Max(dt)
I personally would return the dates in datetime format, rather than converting them...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 11, 2011 at 10:28 am
Because they appear in the SELECT clause instead of the FROM clause the aliases a, b, and c are column aliases, but you are trying to treat a and b...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 8, 2011 at 2:44 pm
Viewing 15 posts - 3,751 through 3,765 (of 4,085 total)