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 |
|
lkiran086
Starting Member
21 Posts |
Posted - 2014-06-18 : 02:15:54
|
| I have 100 tables some columns having Varchar(1000) and I Wan to make them NvarCahr(1000) ...How can I Change them? |
|
|
rocknpop
Posting Yak Master
201 Posts |
Posted - 2014-06-18 : 02:23:19
|
| EXEC sp_msforeachtable 'ALTER TABLE ? ALTER COLUMN COLUMN_NAME NVARCHAR(1000)'--------------------Rock n Roll with SQL |
 |
|
|
lkiran086
Starting Member
21 Posts |
Posted - 2014-06-18 : 02:49:33
|
| There is any option to do for all the tables at a time? |
 |
|
|
rocknpop
Posting Yak Master
201 Posts |
Posted - 2014-06-18 : 03:02:24
|
| Please read about sp_msforeachtable. This refers to all the tables in the DB and ? points to each table.--------------------Rock n Roll with SQL |
 |
|
|
lkiran086
Starting Member
21 Posts |
Posted - 2014-06-18 : 03:11:18
|
| Thanks |
 |
|
|
rocknpop
Posting Yak Master
201 Posts |
Posted - 2014-06-18 : 03:45:45
|
| welcome--------------------Rock n Roll with SQL |
 |
|
|
|
|
|