SQL Server Tips
Thursday, 21 May 2015
Add a column, with a default value, to an existing table in SQL Server
Add a column, with a default value, to an existing table in SQL Server
Declare
@
SQL VarChar
(
1000
)
SELECT
@
SQL
=
'ALTER TABLE my_table ADD '
+
@
column
+
' INT'
Exec
(@
SQL
)
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment