Click here to monitor SSC
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)

scrript to convert datatypes of multiple columns

By ashwin rajiv,

generates an runs a select statement to convert all th olumns of a certain datatype in apirticular table to another datatype
:
eg all columns of type int to varchar etc

the sp takes three parameters namely the table name, source data type and detination data type

generates a select query ad executes it

eg: exec ConvertTableTypes 'ledgerjournaltrans','uniqueidentifier','varchar(36)'

Total article views: 156 | Views in the last 30 days: 2
 
Tags
miscellaneous    
 
Contribute