Forum Replies Created

Viewing 15 posts - 136 through 150 (of 288 total)

  • RE: To execute another statement after update becomes successful

    You can also use @@ROWCOUNT UPDATE MyTable

    SET Col1 = Val1 ...

    IF @@ROWCOUNT > 0

    BEGIN

    -- DO other updates

    ENDIf you have triggers on your table thay could affect the value of @@ROWCOUNT,...

  • RE: number of rows returned different when applying joins

    Missread the original post..

  • RE: Advice on an OR statement

    This probably doesn't add much to the conversation, but as pointed out OR predicates often cause scans..

    Since you have a compound index, you *might* see a gain by changing the...

  • RE: Advice on an OR statement

    DrJogalog (3/31/2010)[hrThanks for the reply.

    Our devlopers have a passion for writing 'no lock's' in their statements. The data returned in these queries should not actually change once written so there...

  • RE: CTEs solution is slower than cursor & recursion

    Unfortunatly, I don't have much time to look at this right now. But, one quick thing that might help to improve the CTE is to get rid of the temp...

  • RE: Speed difference with or without FK

    More importatnly than speed is data integrity.

    But, to your performance question, if you have a foreign key SQL can use that information optimize the query accordingly. Which, can...

  • RE: Not Equal in Inner Join not working

    Paul White (3/17/2010)


    puneet shadija (3/17/2010)


    For getting records present in Table2 but not in Table1,

    you need to join these two tables using left outer join as:

    Select A.*

    from Table2...

  • RE: Identify columns changed

    There are several ways and I'm not sure any are all that great. Take a look in BOL for COLUMNS_UPDATED. That is one of the ways to determine which columns...

  • RE: Add Shrink to database maintenance plan?

    Jeffrey Williams-493691 (2/17/2010)


    And I would disagree with shrinking a database if you are setting it to read only. Why would you fragment the indexes then set the database read...

  • RE: Add Shrink to database maintenance plan?

    Here is a reply from Paul Randal (at the time the Dev Lead, Microsoft SQL Server Storage Engine) about why is shrinking a database not a good idea.. and I...

  • RE: How to script include columns of index

    Sounds like you are looking for more of a script that will generate all your tables. But, you can also script out the table with the idexes via SSMS if...

  • RE: Time Bomb Coding

    Jeff Gray (2/10/2010)


    I think you are the first person I've bumped into that gets this little "bit" of MSSQL trivia.

    LOL! Thanks Jeff, that little quip made my day. 🙂

  • RE: Syntax Error on a Merge Command

    The firsrt thing is the second ON clause should be an AND:USING aaInventoryReorderLocalStock as source

    ON (source.Location=target.IplStockLocation

    AND source.AlternatePart=target.IplPartNumber)

    ...

  • RE: Time Bomb Coding

    If I remember correctly SQL2000 and previous had "issues" with BIT columns.

    I also was dealing with 100+ Million row tables that had many BIT columns and the simple act...

  • RE: Best code for generating sequence numbers

    Admittedly, I’m not sure I fully understand the problem. But, the simple solution seems to be to use a IDENTITY column. Perhaps you need a different table for you “Numbers.”...

Viewing 15 posts - 136 through 150 (of 288 total)