Viewing 15 posts - 3,751 through 3,765 (of 4,087 total)
I think what you are looking for is
WHERE field NOT LIKE '%[^0-9]%'
The square brackets specify a subset of characters determined by the contained expression.
The caret (^) at the beginning of...
April 25, 2011 at 10:17 am
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...
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...
April 22, 2011 at 7:22 am
You could also try the undocumented stored procedure sp_msforeachtable.
Drew
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...
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...
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...
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...
March 23, 2011 at 9:49 am
opc.three (3/17/2011)
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...
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
...
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...
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 ...
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...
March 11, 2011 at 2:48 pm
Viewing 15 posts - 3,751 through 3,765 (of 4,087 total)