Are the posted questions getting worse?

  • WayneS (8/19/2011)


    Tom.Thomson (8/19/2011)


    SQLRNNR (8/19/2011)


    ALZDBA (8/19/2011)


    That's the main reason why I +1-ed on both items.

    Ditto

    Ditto too

    +1 x 2

    Careful now, is that (item +1) x 2 or item + (1 x 2)?

    --------------------------------------
    When you encounter a problem, if the solution isn't readily evident go back to the start and check your assumptions.
    --------------------------------------
    It’s unpleasantly like being drunk.
    What’s so unpleasant about being drunk?
    You ask a glass of water. -- Douglas Adams

  • GSquared (8/19/2011)


    Jeff Moden (8/18/2011)


    I wonder if the new splitter from the "Tally OH!" article would have helped here. I've not done any heavy testing with it against VARCHAR(MAX) but some folks have stated that it works just fine. Personally, I find that any splitter that "joins" with VARCHAR(MAX) is instantly twice as slow.

    The main advantage of a TVP over a string splitter is that multiple columns with enforced data types are easier to manage. The second is that you can define a difference between NULL and an empty string much more easily. The third is performance, if the data is already in an array or dataset in the application, since you can eliminate a fair number of steps by using a TVP instead of concatenating and then re-parsing the data.

    Understood but then there's the step of the initial population of the TVP. I'm definitely NOT a GUI type of person so I have to ask, how would population of the TVP be done from a GUI?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (8/19/2011)


    GSquared (8/19/2011)


    Jeff Moden (8/18/2011)


    I wonder if the new splitter from the "Tally OH!" article would have helped here. I've not done any heavy testing with it against VARCHAR(MAX) but some folks have stated that it works just fine. Personally, I find that any splitter that "joins" with VARCHAR(MAX) is instantly twice as slow.

    The main advantage of a TVP over a string splitter is that multiple columns with enforced data types are easier to manage. The second is that you can define a difference between NULL and an empty string much more easily. The third is performance, if the data is already in an array or dataset in the application, since you can eliminate a fair number of steps by using a TVP instead of concatenating and then re-parsing the data.

    Understood but then there's the step of the initial population of the TVP. I'm definitely NOT a GUI type of person so I have to ask, how would population of the TVP be done from a GUI?

    http://msdn.microsoft.com/en-us/library/bb675163.aspx

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • GilaMonster (8/19/2011)


    Jeff Moden (8/18/2011)


    I've never used them. I've always used something else because they didn't use to be available. Not sure I'd actually use them, either, beccause of the following restriction...

    Table-valued parameters must be passed as input READONLY parameters to Transact-SQL routines. You cannot perform DML operations such as UPDATE, DELETE, or INSERT on a table-valued parameter in the body of a routine.

    ... and because if the data is already in SQL Server somewhere, I don't need to pass a TVP for that information to a stored procedure.

    The restriction is for the procedure that the parameter is passed to. You can't update or delete from that table within the procedure.

    They're incredibly useful when writing parent and multiple child records from a front end with one procedure. I'll have to haul out the front-end code that's used for one, but if you profile all that happens is that a table variable is defined and the rows inserted into it before the procedure starts.

    Yep... I absolutely understood what the restriction meant. Thanks, Gail.

    I'd love to know more about the application concerning parent and multiple child records. If you have the chance to "haul out the front-end code", that would be beneficial to other but I'm not much of a "front-end" code kind of person. A more detailed description of what was done would be much more interesting to me.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Kiara (8/19/2011)


    Jeff Moden (8/18/2011)


    I wonder if the new splitter from the "Tally OH!" article would have helped here. I've not done any heavy testing with it against VARCHAR(MAX) but some folks have stated that it works just fine. Personally, I find that any splitter that "joins" with VARCHAR(MAX) is instantly twice as slow.

    A random tangent on the "Tally Oh!" article - I was just playing around to see if I can modify it to work on varbinary(max) data that is full of 0x00's. For this application, speed isn't as big an issue - but using a traditional tally table takes me three passes and a temp table with this particular mess o' bits, and I wanted to get it down to one pass. So thanks again, Jeff, for taking the time to write up the results of your long and harried sessions with the dust bunnies and the beer popsicles. They are very much appreciated.

    I love adaptation, Kiara. Thanks for the feedback. I'm glad I could help.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • WayneS (8/19/2011)


    Jeff Moden (8/19/2011)


    GSquared (8/19/2011)


    Jeff Moden (8/18/2011)


    I wonder if the new splitter from the "Tally OH!" article would have helped here. I've not done any heavy testing with it against VARCHAR(MAX) but some folks have stated that it works just fine. Personally, I find that any splitter that "joins" with VARCHAR(MAX) is instantly twice as slow.

    The main advantage of a TVP over a string splitter is that multiple columns with enforced data types are easier to manage. The second is that you can define a difference between NULL and an empty string much more easily. The third is performance, if the data is already in an array or dataset in the application, since you can eliminate a fair number of steps by using a TVP instead of concatenating and then re-parsing the data.

    Understood but then there's the step of the initial population of the TVP. I'm definitely NOT a GUI type of person so I have to ask, how would population of the TVP be done from a GUI?

    http://msdn.microsoft.com/en-us/library/bb675163.aspx

    If it were a snake, it would have bitten me. :blush: Thanks, Wayne.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (8/18/2011)


    Personally, I find that any splitter that "joins" with VARCHAR(MAX) is instantly twice as slow.

    Maybe... but twice as slow as greased lightning is still lightning fast!

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • Well, good 'ole divide-n-conquer rules the day today. Optimized three processes today.

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • Jeff Moden (8/19/2011)


    I'd love to know more about the application concerning parent and multiple child records. If you have the chance to "haul out the front-end code", that would be beneficial to other but I'm not much of a "front-end" code kind of person. A more detailed description of what was done would be much more interesting to me.

    No code, but think about a system like Amazon. The TVP allows an easy way to insert the order header and all of the order detail rowss with one stored procedure without having to resort to XML documents (which are not fast) or hacks like concatenated strings. Basically (using .Net) it allows the front end app to pass an entire recordset back to SQL, not a set of values that constitute a single row.

    Makes for a far less chatty app, less database round-trips, easier coding front and backend.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • A beautiful last day of work. I was able to sleep in, and when I did get up I did laundry, got my referee gear out and got ready for my first games of the fall season at the Pride of the Rockies Tournament. Actually went in to work about 2:15, said my final goodbyes to the team, and then meet with my manager. That took all of five minutes and then off to HR, and another five minutes, then to security which, you guessed it, took another five minutes. Done with them.

    After that, it off to the AFA where I had two soccer matches to officiate. Centered the first and tweeked my knee a bit. One of the referees I was working with had a knee brace, and that got me through the rest of the first game and helped in the second game as well.

    Well tomorrow dawns early, and I have six more games starting at 8:00 AM. Same thing on Sunday. When all is said and done I will have officiated 14 games this weekend. That more games than any one team will play all weekend. Well, I get paid and they don't. Makes up for it.

    Monday will be the start of a new day. I will be starting my new job at Progressive and getting back to working with the BEST RDBMS in the business, MySQL MS SQL Server. I am really looking forward to getting back to what I know and love in the databasse world.

  • Lynn Pettis (8/19/2011)


    .... I am really looking forward to getting back to what I know and love in the databasse world.

    Welcome back in our SQLServer universe, Lynn.

    All the best on the new job.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution πŸ˜€

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Lynn Pettis (8/19/2011)[hrMonday will be the start of a new day. I will be starting my new job at Progressive and getting back to working with the BEST RDBMS in the business, MySQL MS SQL Server. I am really looking forward to getting back to what I know and love in the databasse world.

    \i hope the cultural shock of returning to civilisation after all that time in the barbarian orcular wilds will not be too great. Welcome back!

    Tom

  • Lynn Pettis (8/19/2011)


    A beautiful last day of work. I was able to sleep in, and when I did get up I did laundry, got my referee gear out and got ready for my first games of the fall season at the Pride of the Rockies Tournament. Actually went in to work about 2:15, said my final goodbyes to the team, and then meet with my manager. That took all of five minutes and then off to HR, and another five minutes, then to security which, you guessed it, took another five minutes. Done with them.

    After that, it off to the AFA where I had two soccer matches to officiate. Centered the first and tweeked my knee a bit. One of the referees I was working with had a knee brace, and that got me through the rest of the first game and helped in the second game as well.

    Well tomorrow dawns early, and I have six more games starting at 8:00 AM. Same thing on Sunday. When all is said and done I will have officiated 14 games this weekend. That more games than any one team will play all weekend. Well, I get paid and they don't. Makes up for it.

    Monday will be the start of a new day. I will be starting my new job at Progressive and getting back to working with the BEST RDBMS in the business, MySQL MS SQL Server. I am really looking forward to getting back to what I know and love in the databasse world.

    Welcome back, Lynn! I hope you don't explode from the decompression. Don't come up any faster than your bubbles. πŸ˜›

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • GilaMonster (8/19/2011)


    Jeff Moden (8/19/2011)


    I'd love to know more about the application concerning parent and multiple child records. If you have the chance to "haul out the front-end code", that would be beneficial to other but I'm not much of a "front-end" code kind of person. A more detailed description of what was done would be much more interesting to me.

    No code, but think about a system like Amazon. The TVP allows an easy way to insert the order header and all of the order detail rowss with one stored procedure without having to resort to XML documents (which are not fast) or hacks like concatenated strings. Basically (using .Net) it allows the front end app to pass an entire recordset back to SQL, not a set of values that constitute a single row.

    Makes for a far less chatty app, less database round-trips, easier coding front and backend.

    Hmmm... like any table, I thought that all of the rows of a TVP had to have the same number and type of columns in the same order. In this case, how would the order header row and order detail rows appear in the same TVP since they're going to have different columns (unless, of course, you're talking about using two TVP's)? Also, I can see how passing values of numbers might be less chatty than passing their string equivalents, but how is passing an entire recordset via TVP going to require fewer round-trips than passing a string that contains the entire recordset (unless you're talking packet level, of course)?

    I guess I'm just going to have to hucker down and study the bloody things. πŸ˜€

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (8/20/2011)


    Hmmm... like any table, I thought that all of the rows of a TVP had to have the same number and type of columns in the same order. In this case, how would the order header row and order detail rows appear in the same TVP since they're going to have different columns (unless, of course, you're talking about using two TVP's)?

    Yes, two TVPs. Easy, and neat, both for the .NET developer, and the DBA.

    Also, I can see how passing values of numbers might be less chatty than passing their string equivalents, but how is passing an entire recordset via TVP going to require fewer round-trips than passing a string that contains the entire recordset (unless you're talking packet level, of course)?

    It's denser (no delimiters, native format) and the TVP contents take the same fast code path as a bulk load.

Viewing 15 posts - 29,176 through 29,190 (of 66,742 total)

You must be logged in to reply to this topic. Login to reply