Reputation: 319
I'm looking to generate a script of specific table column. How i can do that?
SQL Server 2012 allow to generate a script of a single table but not a single column.
Upvotes: 0
Views: 68
Reputation: 1611
There's no built in functionality to do this. In order to accomplish something like this, you would need to make a script that would go through the system tables to retrieve the information for the column then generate an ALTER TABLE [] ADD [] statement.
I do something like this with temp tables so you can see an example of what that might look like. I would note the code sample provided here is partially complete and updated whenever I encounter a corner case it doesn't cover already.
Upvotes: 1