Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Converting text to varchar

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-01-09 : 10:07:46
Tim writes "I'm converting a SQL 6.5 db to version 7, and I need to convert all the text fields to varchar(7000)'s. I can do this by editing each table individually in Enterprise Manager, but I can't seem to get an SQL statement to do it. According to the Transact-SQL reference, you can't run an Alter table statement on text fields. Any help would be appreciated. "

nr
SQLTeam MVY

12543 Posts

Posted - 2002-01-09 : 11:36:17
Try running the profiler to find out what enterprise manager is doing.
It is probably creating a new table or column and copying all the data across.
You can do this yourself in a query.

==========================================
Cursors are useful if you don't know sql.
Beer is not cold and it isn't fizzy.
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2002-01-09 : 13:14:07
Or, just straight out of EM, edit the table and change one of the fields, then rather than saving the change, click on Save SCRIPT. Then, as nr suggested, you can see how EM handles this. You can expand it to cover the other fields from there.

Go to Top of Page
   

- Advertisement -