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)
 Generate Insert Statement Based on table schema

Author  Topic 

pradeepmanne
Starting Member

31 Posts

Posted - 2012-01-04 : 06:19:04
HI,
can sql genarate a insert statement based on the schema of the target table at run time of same datatype(all are of binary datatype)


DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2012-01-04 : 07:49:49
Yes, but why would you? Just because you CAN does not mean you SHOULD.

http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2012-01-04 : 09:13:50
An alternative to consider is to mechanically generate the statements - then you can hand-tune them if/when you need to.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-01-04 : 10:08:37
what do you mean "at run-time"?

and why would you want to?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2012-01-04 : 10:55:46
Why you would ever want to do this is beyond me personally
Go to Top of Page
   

- Advertisement -