Viewing 15 posts - 1,156 through 1,170 (of 3,544 total)
Depending on how and where the data is retrieved you could use sql CASE statement, ie
UPDATE ...
SET col15 = CASE
WHEN col2 >= 'V000' AND col2 < 'Y99 ' THEN col2
WHEN...
Far away is close at hand in the images of elsewhere.
Anon.
March 29, 2011 at 6:58 am
Or for /* updating parents if no lower ranked scouts exist */
UPDATE g
SET PG_STATUS='INACTIVE'
FROM [PARENT_GUARDIAN_TEMP] g
JOIN (SELECT g.PG_ID
FROM [PARENT_GUARDIAN_TEMP] g
JOIN [xref_PG_SCT_TEMP] x ON x.PG_ID=g.PG_ID
JOIN...
Far away is close at hand in the images of elsewhere.
Anon.
March 29, 2011 at 2:10 am
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.
Far away is close at hand in the images of elsewhere.
Anon.
March 17, 2011 at 10:42 am
toddasd (3/17/2011)
Does SS just ignore the spaces when comparing '% rate %' to 'rate'?
No the spaces are important. You wanted to find particular words ie rate and words are separated...
Far away is close at hand in the images of elsewhere.
Anon.
March 17, 2011 at 9:20 am
Koen Verbeeck (3/17/2011)
Jeff, stop interfering in SSIS threads. 😛 😀
Ahhh!!! Be nice to Jeff, he can't help it if he is stuck in a T-SQL sandbox and can't come out...
Far away is close at hand in the images of elsewhere.
Anon.
March 17, 2011 at 8:15 am
WHERE CHARINDEX(' rate ', ' '+col+' ') > 0
or
WHERE ' '+col+' ' LIKE '% rate %'
Far away is close at hand in the images of elsewhere.
Anon.
March 17, 2011 at 7:56 am
sqlserver12345 (3/15/2011)
Does not work.....Msg 241, Level 16, State 1, Line 1
Conversion failed when converting datetime from character string.
Date conversion is also dictated by the language setting of the login as...
Far away is close at hand in the images of elsewhere.
Anon.
March 16, 2011 at 11:08 am
Using DelimitedSplit8K code and a Tally table
WITH split (ItemNumber,Item) AS (
SELECT ROW_NUMBER() OVER (ORDER BY t.N) AS [ItemNumber],
SUBSTRING(tbl.[Text], t.N, CHARINDEX(' ',...
Far away is close at hand in the images of elsewhere.
Anon.
March 16, 2011 at 8:16 am
My suggestion would be to create a temp table (including a TempID identity column) of all the data to be inserted/used from TableC
Insert into TableA from this temp table but...
Far away is close at hand in the images of elsewhere.
Anon.
March 14, 2011 at 9:11 am
Also check that mdmpa.message_text does not have non space chars following "ALL MET ITEMS FOR VIN PROCESSED SUCCESSFULLY"
Far away is close at hand in the images of elsewhere.
Anon.
March 14, 2011 at 7:41 am
I think the issue is on "SUBSTRING(bd.buft_string_1, 35, 70) = mdmpa.message_text"
Did you prove this by removing the join and getting rows returned?
If it is the substring then the most likely...
Far away is close at hand in the images of elsewhere.
Anon.
March 14, 2011 at 7:39 am
TK-42-1 (3/11/2011)
That worked and actually solved another problem I was having with some of the notification side of it.Thank you.
You're welcome and thank you for the reply 🙂
And remember there...
Far away is close at hand in the images of elsewhere.
Anon.
March 13, 2011 at 3:10 pm
Put
BEGIN TRY
END TRY
BEGIN CATCH
END CATCH
around your exec
e.g.
BEGIN TRY
EXEC (@query)
END TRY
BEGIN CATCH
PRINT @net + ' Failed'
END CATCH
Far away is close at hand in the images of elsewhere.
Anon.
March 11, 2011 at 10:36 am
Sorry my bad the inner CASE is missing END, try this
AND CASE WHEN MG_BOOKING.TRADE_CD IS NULL THEN
CASE WHEN BA.TRADE IN (select distinct Item From dbo.Split(@trades,',')) THEN 1 ELSE 0...
Far away is close at hand in the images of elsewhere.
Anon.
March 9, 2011 at 9:59 am
pwalter83 (3/9/2011)
Thanks a lot for your answers but would it be possible to convert your solution in a way that they can be included in the WHERE...
Far away is close at hand in the images of elsewhere.
Anon.
March 9, 2011 at 9:22 am
Viewing 15 posts - 1,156 through 1,170 (of 3,544 total)