laurenq uantrell (la*************@hotmail.com) writes:
I want to copy all columns from tblA into tblB where tblA.UniqueID =
parameter @ID without having to list each column name in an insert
statement. Is this possible?
Under some circumstances, yes.
Then again, in application code, I think it is very bad practice to say:
INSERT tbl2 SELECT * FROM tbl1
SELECT * itself is bad practice, so are INSERT statements without listing
of target columns.
Why are this bad:
* You cannot see if a column is actually used.
* If the table defintion changes, the result of the SELECT changes.
* And for INSERT it is likely to result in the INSERT statment failing.
--
Erland Sommarskog, SQL Server MVP,
es****@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp