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.
| Author |
Topic |
|
ashuadi
Starting Member
5 Posts |
Posted - 2007-06-10 : 17:21:36
|
| Hi,I am new to SQL Server and need your help. I have a table (old_table) with about 500 columns and each column of type varchar. I have to generate a table (new_table) which has all the columns of the old table but with different data types.Is there a way I can use the syscolumns to generate a “create table” statement? Thanks. |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-06-10 : 19:03:54
|
| You can generate script of the old table then modify the script. |
 |
|
|
ashuadi
Starting Member
5 Posts |
Posted - 2007-06-10 : 19:12:23
|
| Actually I had a .dat file which i imported into sql server as old_table.i can write the create table statement with 500 columns but i thought there would be a better way to do this using syscolumns. any help would be appreciated. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-06-10 : 22:53:22
|
You can use Enterprise Manager (2000) or SQL Server Management Studio (2005) right click on the table to generate the script. KH |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|