Viewing 15 posts - 721 through 735 (of 1,473 total)
Ryan Keast (9/4/2009)
When I run that last query I get the following errors -
Server: Msg 170, Level 15, State 1, Line 33
Line 33:...
September 4, 2009 at 7:57 am
I've found this to be more helpful than most of the books I've read:
http://www.sqlservercentral.com/Forums/Forum338-1.aspx 😉
Also, following people's blogs, reading the articles on this site, etc.
It's all in...
September 4, 2009 at 7:42 am
Jeff Moden (3/27/2008)
For example...
DECLARE @Sku NVARCHAR(500)
SET @Sku = '000000000000000000000000000000000000000000000000000000012335670000'
SELECT @Sku AS Original,
SUBSTRING(@Sku,PATINDEX('%[^0]%',@Sku),DATALENGTH(@Sku)) AS NoLeadingZeros
Heh... no, you're right, Matt. I was just anticipating the next possible question (I should...
September 3, 2009 at 5:02 pm
drew.allen (9/1/2009)
September 1, 2009 at 3:00 pm
Do you know ahead of time how many columns you need for this project, or does it vary depending on how many different are in the table?
This is what is...
September 1, 2009 at 7:51 am
Duplicate Post. Please direct all replies to this thread.
September 1, 2009 at 7:46 am
ramadesai108 (8/31/2009)
Hi Garadin,That worked. Thank you for your time. You saved my life.
Glad to help. It's not every day I get to save a life!...
August 31, 2009 at 2:21 pm
You're very close, just switch it around slightly to only add the sections when it's not null, like the following:
SELECT
IMSV7.TBL308.DESCRIPT, IMSV7.PARCEL.SECTION, IMSV7.PARCEL.BLOCK,
IMSV7.TBL308.DESCRIPT + ISNULL(' SUB ' + IMSV7.PARCEL.SECTION, '') +...
August 31, 2009 at 10:27 am
The records are likely passing through your join and then being filtered by your WHERE. If the records don't exist, they can't have KUNNR < '0000900000'.
Try moving the WHERE...
August 31, 2009 at 10:22 am
I already flagged this mass duping for cleanup since there are 6 of them, so here's what Lynn posted on the other thread (So it can be deleted).
Lynn Pettis
August 31, 2009 at 9:30 am
This should work.
DECLARE @TestSeq VARCHAR(20)
SET @TestSeq = 'A2000'
SELECT RIGHT(@TestSeq, PATINDEX('%[^0-9]%',REVERSE(@TestSeq))-1)
August 31, 2009 at 7:49 am
Pakki,
You can do something like this:
DECLARE @TestSeq VARCHAR(20)
SET @TestSeq = '123-4567-89.123'
SELECT CASE WHEN @TestSeq LIKE '[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9].[0-9][0-9][0-9]'
THEN 'Passed'
ELSE 'Failed'
END
August 31, 2009 at 7:40 am
You can't rely on a where clause to stop these types of errors. This will happen quite commonly. Where's are not necessarily evaluated before the select, the only...
August 30, 2009 at 8:16 pm
Viewing 15 posts - 721 through 735 (of 1,473 total)