Forum Replies Created

Viewing 15 posts - 301 through 315 (of 345 total)

  • RE: Trigger - for specific inserts only.

    repent_kog_is_near (4/1/2011)


    >>when do you want it to fire and what do you want the fire action to be?

    the trigger, ideally, should be fired only when there is a new row...

  • RE: Trigger - for specific inserts only.

    repent_kog_is_near (3/31/2011)


    example: trigger should fire only when AccountFK is not NULL in an insert int tblProject ; if AccountFK is populated, don't bother.

    So it should only fire when it's not...

  • RE: T-SQL PROBLEM

    declare @WSUrid numeric

    Why is this ID field a numeric? You have decimal IDs?

    set @WSPrice1 = 'Select ISNULL(' + @WSUrnam + ',0) from dbo.productstb where productid = '...

  • RE: How to display the database data

    tamir-859073 (3/29/2011)


    How to display the database data

    Easy, use the code listed in this post http://www.sqlservercentral.com/Forums/Topic1082905-1292-1.aspx

  • RE: stored procedure

    You mostly have what you need. Put a "Union All" between the selects.

  • RE: Migration of Data into table with dependencies

    beginner123 (3/23/2011)


    I have to migrate data into the table which has dependencies. I want to insert data into parent table by using Insert Into command. If I do that will...

  • RE: Problem with a TRIGGER INSERT

    Why can't you get the account# you are trying to insert before you insert into table ml? It seems you have all available info needed at point of insert, but...

  • RE: Problem with a TRIGGER INSERT

    Whenever you start a trigger out by assigning variables, you've lost. Think about your statement

    SELECT @stamp = mlstamp, @cct = RTRIM(cct), @dim1 = RTRIM(dim1), @dim2 = RTRIM(dim2),

    @dim3 = RTRIM(dim3), @dim4...

  • RE: Change object owner.

    The GO statement marks the end of the batch and will end the procedure. Remove the GO from the middle of your create procedure script.

  • RE: Searching a column for a word

    Yep, this is my new favorite. Thanks Drew.

    If this improvement keeps up every post, pretty soon this will be a built-in SS function! Oh wait...:-)

  • RE: Searching a column for a word

    Yep, that may be a little shorter than my version 😉

    select * from #test where ' '+col+' ' like '%[!",.'':;? ]rate[!",.'':;? ]%'

    Thanks David.

  • RE: Searching a column for a word

    Ok, now I see where my question was silly. It's not comparing '% rate %' to 'rate' because you added the spaces before and after and then did the wildcard...

  • RE: Searching a column for a word

    David Burrows (3/17/2011)


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

    or

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

    Perfect, David. Works great, but why does it work? Does SS just ignore...

  • RE: Searching a column for a word

    I must admit I am impressed with the cleverness of your solution...but I have another failed test clause. Insert the word 'substrate' to the #test and your query will select...

  • RE: Searching a column for a word

    Thanks for the quick reply CC, but I don't want to search for the phrase 'rate is 5', I only want results that have the word 'rate'.

    Let me add...

Viewing 15 posts - 301 through 315 (of 345 total)