SQL Server 2008 T-SQL Enhancements Part - II

  • Comments posted to this topic are about the item SQL Server 2008 T-SQL Enhancements Part - II

    With Thanks and Regards
    Arshad Ali
    Microsoft India

    My Blog - http://arshadali.blogspot.com/[/url]

  • Nice summary. Probably the biggest disappointment with TVPs is how promising they are in concept but how limiting they are in practice. Its unfortunate that one needs to define a .NET data table by hand, to exactly match a TVP, instead of being able to just define a datatable as being of type of the TVP itself.

    Its also a tremendous disappointment that Entity Framework does not support TVPs (even in .NET 4).

    SQL Server developments often seem so disjointed. What I was really was hoping to see released was something more "object oriented" - to use that abused phrase - something like (a) to be able to define a table "type" (or "class" or "template" or whatever you want to call it), and (b) be able to create a table as of that type, and (c) be able to create a TVP as of that type, and (d) to be able to create an ADO data table as of that type, etc.

    (Heck - make "MERGE" know about templates so that when its input is a table and a correspondlingly matched TVP, then it would automatically know how to do its field by field upsert ..)

    Anyhow, one abstraction for a "data template definition" and many concrete implementation of that template. And EF supported ! Wouldn't that be nice?

  • Thanks for theses articles. I can't wait to start using TVP. I will see an immediate change in my web app structure. I already have found myself using strongly typed datatables more often for complex transactions despite the extra work. Now being able to insert in bulk instead of looping rows is a significant improvement. Enough so, that some of the refactoring I have been planning on doing has more value. I would love to read your enhancement summary on time zones. This also has some serious potential for considering app structure changes. Thanks again!

  • Nice article, I especially appreciated how you included the .NET example of passing a table type parameter. Many articles leave this peace out.

    I would have appreciated a few more examples with the datetime datatypes.

  • hi arshad,

    I would appreciate if you can put down a piece of code to how it was implemented in SQL Server 2005 ...It can be either using Temp tables or many parameter. A simple example is needed.

    Thanks,

    D

  • In SQL 2005 you can use XML data Type to pass structured data to stored procedure, instead of TVP.

  • Nice article.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • I agree, XML is nice. I use XML in similar cases.

  • We are using TVP's in a call to a stored procedure. The proc takes three arguments of which all are TVP's. This functionality does not seem to scale at all, no

    matter how many threads are calling the stored procedure, it always performs the same.

    We removed all functionality in the proc but this made almost no difference.

    It seems that the major time is spent in the passing of the TVP's from the .net dataaccess code to the stored procedure.

    Could there be that there are some locks involved?

    Is the TVP's not recommended if you call the stored proc at a high frequency?

    Do we have to send batches instead to achieve any performance?

  • really gr8 ariticle 🙂

    but one thing I'd like to say order of columns must match in Table Type(DB) and Passing Table(.NET).

    is there any solution for this. plz shere it.

    Thanks,

Viewing 10 posts - 1 through 9 (of 9 total)

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