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
 General SQL Server Forums
 New to SQL Server Programming
 Help Needed...with Dynamic table creation

Author  Topic 

sravan.here
Starting Member

4 Posts

Posted - 2013-04-18 : 19:13:01
Have a Table with the CSV Values in the columns as below

ID Name text
1 SID,DOB 123,12/01/1990
2 City,State,Zip NewYork,NewYork,01234
3 SID,DOB 456,12/21/1990

What i need is to get is 2 tables in this scenario as out put with the corresponding values , These table should be generated Dynamically as the values in the source table varies every week.

ID SID DOB
1 123 12/01/1990
3 456 12/21/1990


ID City State Zip
2 NewYork NewYork 01234

Is there any way of achieving it using a Cursor/Procedure or any other method in SQL server?

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2013-04-18 : 20:00:07
Would you mind explaining what you are trying to achomplish?

Of course, just about anything CAN be done. But, just because can dosn't mean it should. Perhaps, it might make more sense to use Entity-Attribute-Value (EAV) pattern? I admit I'm not a huge fan of EAV, but I suspect it'll be better then trying to dynamically create tables will get you.
Go to Top of Page
   

- Advertisement -