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.
| Author |
Topic |
|
ranjeetsingh_6
Posting Yak Master
125 Posts |
Posted - 2010-12-29 : 04:35:34
|
| Hi,I want to insert rows into table but columns may or may not be exists into table so how row will insert if column not exist because column depends upon front end application that is in .NET.Can it be happen by pivot table to insert rows.please suggest me.Thanks,Ranjeet kumar singhRanjeet Kumar Singh |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2010-12-29 : 04:42:49
|
| >> how row will insert if column not existWhat do you want to do with the data for the missing columns?==========================================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. |
 |
|
|
jcelko
Esteemed SQL Purist
547 Posts |
Posted - 2010-12-29 : 15:34:45
|
| >> I want to insert rows into table but columns may or may not be exists in the table so how row will insert if column not exist because column depends upon front end application that is in .NET.Can it be happen by pivot table to insert rows.please suggest me. << Please read any book on basic RDBMS and SQL. Tables have a fixed, known set of columns. They do not change shape. You can use DEFAULTs to complete the rows. Good SQL programmers do not use PIVOT and they knwo it is not really a table at all.--CELKO--Books in Celko Series for Morgan-Kaufmann PublishingAnalytics and OLAP in SQLData and Databases: Concepts in Practice Data, Measurements and Standards in SQLSQL for SmartiesSQL Programming Style SQL Puzzles and Answers Thinking in SetsTrees and Hierarchies in SQL |
 |
|
|
|
|
|