From: Michael Coles on 21 Dec 2009 22:21 If you're using unmanaged C/C++ and ODBC, check this out: http://msdn.microsoft.com/en-us/library/bb510467.aspx It looks similar to the ODBC Bulk Copy API. -- Thanks Michael Coles SQL Server MVP Author, "Expert SQL Server 2008 Encryption" (http://www.apress.com/book/view/1430224649) ---------------- "Michael Coles" <admin(a)geocodenet.com> wrote in message news:FA6618EF-02C9-4D65-AD48-CF5EE219D92A(a)microsoft.com... > OK, you say you have C code. Would that be C++ (managed/unmanaged), C#, > or do you really mean unmanaged "C"? If you really do mean unmanaged "C", > pop the link up here to the docs you're looking at. If you're actually > using managed code (managed C++ or C#), your best bet is probably to use a > .NET DataTable. > > -- > Thanks > > Michael Coles > SQL Server MVP > Author, "Expert SQL Server 2008 Encryption" > (http://www.apress.com/book/view/1430224649) > ---------------- > > "Leon McCalla" <leonmccalla(a)drop.hotmail.com> wrote in message > news:%23iGGadSgKHA.2104(a)TK2MSFTNGP05.phx.gbl... >> Can we use row-wise binding instead of column binding with TVPs? >> Basically the C code I have generates a 25 column temp-array with 1-16 >> rows. The documentation for TVPs seems require 25 separate single >> column arrays. >> >> Help.......... >> >> Leon >> >
From: Leon McCalla on 22 Dec 2009 10:01 thanks.. ultimately this is what i had to do since my data was in rows and TVP required the array to be in columns. anyway is DATA-AT-EXEC much slower than ALL-IN-MEMORY? Leon "Michael Coles" <admin(a)geocodenet.com> wrote in message news:12BD8664-2D78-4EC4-A64E-EC550416146C(a)microsoft.com... > If you're using unmanaged C/C++ and ODBC, check this out: > http://msdn.microsoft.com/en-us/library/bb510467.aspx > > It looks similar to the ODBC Bulk Copy API. > > -- > Thanks > > Michael Coles > SQL Server MVP > Author, "Expert SQL Server 2008 Encryption" > (http://www.apress.com/book/view/1430224649) > ---------------- > > "Michael Coles" <admin(a)geocodenet.com> wrote in message > news:FA6618EF-02C9-4D65-AD48-CF5EE219D92A(a)microsoft.com... >> OK, you say you have C code. Would that be C++ (managed/unmanaged), C#, >> or do you really mean unmanaged "C"? If you really do mean unmanaged >> "C", pop the link up here to the docs you're looking at. If you're >> actually using managed code (managed C++ or C#), your best bet is >> probably to use a .NET DataTable. >> >> -- >> Thanks >> >> Michael Coles >> SQL Server MVP >> Author, "Expert SQL Server 2008 Encryption" >> (http://www.apress.com/book/view/1430224649) >> ---------------- >> >> "Leon McCalla" <leonmccalla(a)drop.hotmail.com> wrote in message >> news:%23iGGadSgKHA.2104(a)TK2MSFTNGP05.phx.gbl... >>> Can we use row-wise binding instead of column binding with TVPs? >>> Basically the C code I have generates a 25 column temp-array with 1-16 >>> rows. The documentation for TVPs seems require 25 separate single >>> column arrays. >>> >>> Help.......... >>> >>> Leon >>> >> >
From: Leon McCalla on 22 Dec 2009 11:50 I'm programming in C and I'm migrating to TVPs with a SP in order to avoid round-trips to the server for individual inserts. Is data-at-exec much slower than all-in-memory? do these round trips go between the driver and my program or the program and the server? Thanks Leon "m" <m(a)b.c> wrote in message news:ee7K0KqgKHA.5792(a)TK2MSFTNGP05.phx.gbl... > transpose the array and use it (If the array is large, then you can use > data at exec and pass it in pieces to avoid double buffering) >
From: Michael Coles on 22 Dec 2009 20:00 There can be a performance difference, but the real factor is how much data you're actually pushing using this method. As an alternative you could pass the data as an XML string and shred it on the server using the XML .nodes() method. I used to do this on SQL 2005, before TVPs were available on 2008. It might definitely be easier in your case, especially since you're writing unmanaged code using ODBC. I don't know if you can convince your boss to let you write .NET code, but this is a prime example of where managed code would be much easier to create in the short term and a lot easier to maintain in the long term. -- Thanks Michael Coles SQL Server MVP Author, "Expert SQL Server 2008 Encryption" (http://www.apress.com/book/view/1430224649) ---------------- "Leon McCalla" <leonmccalla(a)drop.hotmail.com> wrote in message news:uMeteexgKHA.2596(a)TK2MSFTNGP04.phx.gbl... > thanks.. > ultimately this is what i had to do since my data was in rows and TVP > required the array to be in columns. > > anyway is DATA-AT-EXEC much slower than ALL-IN-MEMORY? > > Leon > > > > > "Michael Coles" <admin(a)geocodenet.com> wrote in message > news:12BD8664-2D78-4EC4-A64E-EC550416146C(a)microsoft.com... >> If you're using unmanaged C/C++ and ODBC, check this out: >> http://msdn.microsoft.com/en-us/library/bb510467.aspx >> >> It looks similar to the ODBC Bulk Copy API. >> >> -- >> Thanks >> >> Michael Coles >> SQL Server MVP >> Author, "Expert SQL Server 2008 Encryption" >> (http://www.apress.com/book/view/1430224649) >> ---------------- >> >> "Michael Coles" <admin(a)geocodenet.com> wrote in message >> news:FA6618EF-02C9-4D65-AD48-CF5EE219D92A(a)microsoft.com... >>> OK, you say you have C code. Would that be C++ (managed/unmanaged), C#, >>> or do you really mean unmanaged "C"? If you really do mean unmanaged >>> "C", pop the link up here to the docs you're looking at. If you're >>> actually using managed code (managed C++ or C#), your best bet is >>> probably to use a .NET DataTable. >>> >>> -- >>> Thanks >>> >>> Michael Coles >>> SQL Server MVP >>> Author, "Expert SQL Server 2008 Encryption" >>> (http://www.apress.com/book/view/1430224649) >>> ---------------- >>> >>> "Leon McCalla" <leonmccalla(a)drop.hotmail.com> wrote in message >>> news:%23iGGadSgKHA.2104(a)TK2MSFTNGP05.phx.gbl... >>>> Can we use row-wise binding instead of column binding with TVPs? >>>> Basically the C code I have generates a 25 column temp-array with 1-16 >>>> rows. The documentation for TVPs seems require 25 separate single >>>> column arrays. >>>> >>>> Help.......... >>>> >>>> Leon >>>> >>> >> > >
From: m on 22 Dec 2009 21:12 IIRC, data at exec does not increase round-trips. The only difference is that the app provides the values to the driver in pieces when it actually needs to be sent to the server instead of in a complete buffer beforehand. "Leon McCalla" <leonmccalla(a)drop.hotmail.com> wrote in message news:OxhkSbygKHA.2596(a)TK2MSFTNGP04.phx.gbl... > I'm programming in C and I'm migrating to TVPs with a SP in order to avoid > round-trips to the server for individual inserts. Is data-at-exec much > slower than all-in-memory? do these round trips go between the driver and > my program or the program and the server? > > Thanks > > Leon > > "m" <m(a)b.c> wrote in message news:ee7K0KqgKHA.5792(a)TK2MSFTNGP05.phx.gbl... >> transpose the array and use it (If the array is large, then you can use >> data at exec and pass it in pieces to avoid double buffering) >> >
First
|
Prev
|
Pages: 1 2 Prev: How do I creat a auto increment for my key field Next: loop between 2 datetime field values |