• SQLTestUser (6/18/2013)


    Thanks for the reply,

    i am looking for Null values and based on those null values i want to update a column in one of the tables. A trigger that would update on insert or update with a update statement that has if statements

    thanks

    No offense but you are talking in circles here. I thought you wanted to update ONE table, but now we are back to updating multiple tables.

    An update cannot have IF statements. In t-sql IF statements are used to control flow of processing statements. You might need a case expression in your update statement. I do not have even close to a clear picture of what you are doing here. If you can post ddl for ALL of the tables and some data along with a clear definition of what you are trying to do I will do my best to help.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/