Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Table Type Variable

Author  Topic 

juicyapple
Posting Yak Master

176 Posts

Posted - 2012-08-27 : 03:18:18
Hi, I know that we can pass table type variable from .Net to store procedure, but the table type need to be physically created first. I have a situation where the table type structure is dinamically changed (the number of columns are different). Is there any idea to handle this?

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2012-08-27 : 04:30:27
You can have a generic table with many character columns - just fill in the columns that are needed.


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-08-27 : 07:16:29
Another alternative to creating the table types might be send the data from .Net as XML. .Net is very good and efficient at composing XML (using LINQ) and for flat tabular data, SQL is decent enough in shredding that data. There are other ways as well, described in Sommarskog's blog here: http://www.sommarskog.se/arrays-in-sql.html
Go to Top of Page
   

- Advertisement -