Good evening,
Would appreciate any feedback and thank you in advance. How do you change the data type in a SQL Server table. I seem to be able to change the data type, but can't save the changes.
If order to change the datatype of a column you have to create a new table with a new name with the new column data type, then copy all the data into the new table. After the data has been copied drop the original table, create the indexes using the original names and rename the table to the name of the original table.
Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)
Thanks for the answers. Now, after I changed the data type in the column I realized I needed to refresh and then I would see the changes. So, is it wrong to just select modify table and change the data type that way?
>> So, is it wrong to just select modify table and change the data type that way?
No, there's nothing wrong with doing it that way.
The process that mrdenny describes occurs auto-magically for you by Enterprise Manager when you modify the data type. If you wanted to write a T-SQL script to do this, then mrdenny's advice would be the way to do it.
Make sense?
-George
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.