| | |
Changing the datatype of a Column
Please support our MS SQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2005
Posts: 13
Reputation:
Solved Threads: 0
G'd evening!
In case you still need to change the table's column type from T-SQL , the sintax for MS SQL is:
ALTER TABLE table ALTER COLUMN column_name new_data_type
Ex.
ALTER TABLE MyTable ALTER COLUMN MyColumn NVARCHAR(20)
For more about the Alter Table sintax, read the books on line (BOL), here is the last update for SQL 2k SQL Server Books Online January 2004 Update
Good luck
Estuardo
In case you still need to change the table's column type from T-SQL , the sintax for MS SQL is:
ALTER TABLE table ALTER COLUMN column_name new_data_type
Ex.
ALTER TABLE MyTable ALTER COLUMN MyColumn NVARCHAR(20)
For more about the Alter Table sintax, read the books on line (BOL), here is the last update for SQL 2k SQL Server Books Online January 2004 Update
Good luck
Estuardo
![]() |
Similar Threads
- C++ enumerated data type help (C++)
- SQL Create table error (ASP.NET)
- dynamic td's not tr's (ColdFusion)
- Good Luck w/This one: Excel Question VBA/Macro/other (MS Access and FileMaker Pro)
Other Threads in the MS SQL Forum
- Previous Thread: MS SQL: Converting row printing to column based printing
- Next Thread: how to delete duplicate record in a table by using SQL query
Views: 78099 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for MS SQL
"last age autogrowth business connectingtodatabaseinuse count cursor data database dateadd datediff datepart day" dbsize deadlock delete_trigger exploit getdate hack highperformancecomputing hpc hpcserver2008 ibm iis limit live loop maximum microsoft ms mssql multiple multithreading news number password permission position query reporting result security server services sets single source sql sql-injection sqlserver sqlserver2005 subtype supercomputing supertype tables uniqueid update view weekday





