Alter Table Script In Sql Server 2008. If there is a problem with a table definition say I need to add or rename a column I have to drop it and completely recreate it. Across about 15 tables I have 1600 VARCHAR columns that need to be changed to NVARCHAR.
The above ALTER TABLE RENAME SQL script will change the Employee table as below. If there is a problem with a table definition say I need to add or rename a column I have to drop it and completely recreate it. New Column is created with the name as Course_Start_Date in Course_Title table.
I was able to generate all the appropriate ALTER TABLE statements with a query but now I am faced with the problem of running them.
Following script will work with SQL Server 2005 SP2 and SQL Server 2008. ALTER TABLE PartitionTable1 REBUILD PARTITION 1 WITH DATA_COMPRESSION NONE. As a part of my best practices I always save the T-SQL scripts used for creation and modification of objects in SQL Server. SQL Server ALTER TABLE ADD column examples.