SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Change column type on constrained columns

By Luiz Barros,

Just pass the table name, column name and new data type.

For example, if you want to alter the tblCustomers.CustomerID column type from SmallInt to INT, use:

[LSP_ChangeColumnType] @Table='tblCustomers', @Field='CustomerID', @NewDataType='INT'

Don't forget to backup your database before doing this. Can't hurt, right?

Total article views: 1096 | Views in the last 30 days: 216