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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-04-19 : 10:22:02
|
| Don writes "How do you pass variables to the Alter Table command that would add a new column based on a script variable?I tried this but syntax errors;CREATE PROCEDURE addcolumn AS decalre @Newcolumn nvarchar alter table Indutil add @newColumn nvarchar(100) null" |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2006-04-19 : 10:24:08
|
| You can't do it that way without using dynamic SQL, and it is an extremely bad practice in any event. Adding columns in such a manner is a good indication that your database is not properly designed, especially if you'd allow an end user to call a stored procedure to do it. |
 |
|
|
|
|
|