Forum Replies Created

Viewing 15 posts - 256 through 270 (of 428 total)

  • RE: Query on Multiple Tables. JOIN help needed

    You've made it very hard on yourself by putting spaces in the table and column names. It's not impossible, but it is not according common naming conventions to put these...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: SQL 2008 - T-SQL query assistance

    Of course I won't put the employee name in the table, I did get that this is just an example. I just took the table from Joe's example and extended...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Try catch in a transaction block or transaction in try catch block???

    SQL Kiwi (9/23/2011)


    R.P.Rozema (9/23/2011)


    In a perfect world you are right, a transaction get started or it doesn't. But that's exactly my point here: if "begin transaction" fails, will the transaction...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Try catch in a transaction block or transaction in try catch block???

    Both examples you gave, the break in SSMS and a query timeout, are client-side events. My idea is that shouldn't then their consequences not be handled at the client side...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: SQL 2008 - T-SQL query assistance

    Assuming I want to store multiple, independent sets in one table. Say, following Joe's example, I need to store the organisational hierarchy for multiple companies. My feeling says I should...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Try catch in a transaction block or transaction in try catch block???

    B.T.W. I have created a connect item for the fact that assigning an invalid xml invalidates the transaction, even on an unlogged action. I would appreciate any votes for it:...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Try catch in a transaction block or transaction in try catch block???

    SQL Kiwi (9/23/2011)Yes either way is fine. Not sure what you mean by 'uninitialised transaction' though - either a transaction gets started, or it doesn't. Any sane CATCH...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Try catch in a transaction block or transaction in try catch block???

    Books Online states that

    Although BEGIN TRANSACTION starts a local transaction, it is not recorded in the transaction log until the application subsequently performs an action that must be recorded...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Regarding comparing Indexes

    You can run below query on both databases and compare the output using some text comparison tool. Don't forget to set your query output to 'Results to Grid' (Ctrl+D), or...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: SQL 2008 - T-SQL query assistance

    Hi Jeff, did you find some time to work on some examples for us on nested sets?



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: How to solve this error

    LutzM (9/17/2011)


    This error is caused by two (or more) concurrent processes trying to acess/modify the same data and waiting for each other to finish.

    A more detailed description can be found...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Display Column Name Differently

    You do realise that "adding proper column names" is typical front-end task, don't you. i.e. you shouldn't want to do that in T-SQL.

    There is only one way you can 'change'...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Stored procedure help

    It's not duplicates introduced by the splitter that should be eliminated, it's duplicates in the input that need to be removed per the requirement.

    Try this for your input:

    DECLARE @table...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Stored procedure help

    And add distinct to return only unique values.

    edit: sorry, missed the group by

    edit 2: the requirement "non duplicate rows" is not met yet. You could try something like this:

    SELECT t.ID,...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Number of tables in database

    You are most likely not going to use all information from these different format xml files. Likely you will only use a subset of elements and attributes of each format....



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

Viewing 15 posts - 256 through 270 (of 428 total)