Forum Replies Created

Viewing 15 posts - 1,156 through 1,170 (of 3,543 total)

  • RE: Updating Records Based on Select Results

    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...

  • RE: Searching a column for a word

    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.

  • RE: Searching a column for a word

    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...

  • RE: Split Comma Seperate Column Problem

    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...

  • RE: Searching a column for a word

    WHERE CHARINDEX(' rate ', ' '+col+' ') > 0

    or

    WHERE ' '+col+' ' LIKE '% rate %'

  • RE: Varchar to datetime

    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...

  • RE: String

    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(' ',...

  • RE: INSERT OUTPUT INTO (With an extra column) and SELECT statement

    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...

  • RE: SUBSTRING Question?

    Also check that mdmpa.message_text does not have non space chars following "ALL MET ITEMS FOR VIN PROCESSED SUCCESSFULLY"

  • RE: SUBSTRING Question?

    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...

  • RE: query data from multiple linked servers

    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...

  • RE: query data from multiple linked servers

    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

  • RE: Condition in Where clause query

    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...

  • RE: Condition in Where clause query

    pwalter83 (3/9/2011)


    Hi Gail and David,

    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...

  • RE: Condition in Where clause query

    What is the definition of the input parameter?

    At a guess

    If input parameter TRADE is singular then

    CASE WHEN MG_BOOKING.TRADE IS NULL THEN CASE WHEN MG_BILL.TRADE = @TRADE THEN 1

    ...

Viewing 15 posts - 1,156 through 1,170 (of 3,543 total)