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
 General SQL Server Forums
 New to SQL Server Programming
 how to alter multiple columns at time

Author  Topic 

saivyshnav
Starting Member

17 Posts

Posted - 2006-12-04 : 14:10:01
Hi all

ALTER TABLE <Table_Name> ALTER COLUMN <column_name> <Data_type>

above query alters the sigle column but how to alter multiple columns at time

saivyshnav
Junior DBA

X002548
Not Just a Number

15586 Posts

Posted - 2006-12-04 : 14:16:51
you can't...and besides your better off to unload, drop, create and reload the data



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam






Look at that


Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-12-04 : 14:16:51
I create a new temporary table with the appropriate column definitions, cop the data over, drop the original, rename the Temporary to become the Master table.

You can use Enterprise Manger's "Table design" which will do all the necessary steps "behind the scenes"

Kristen
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-12-04 : 14:20:59
I can't SNIPE you AFTER you've posted .... Sheesh!
Go to Top of Page

sponguru_dba
Yak Posting Veteran

93 Posts

Posted - 2006-12-05 : 05:59:20
Hi sai

It is not possible seems

you try column by column


SreenivasaRao
Bangalore,INDIA
Go to Top of Page

sponguru_dba
Yak Posting Veteran

93 Posts

Posted - 2006-12-05 : 06:02:29
Hi sai

fallow the Kristen suggestion or do column by column alter

I create a new temporary table with the appropriate column definitions, cop the data over, drop the original, rename the Temporary to become the Master table.

You can use Enterprise Manger's "Table design" which will do all the necessary steps "behind the scenes"

SreenivasaRao
Bangalore,INDIA
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2006-12-05 : 09:07:20
quote:
Originally posted by Kristen

I can't SNIPE you AFTER you've posted .... Sheesh!



It was the same exact second...and I sniped you by milliseconds...



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-12-05 : 10:50:45
that's probably the first time that happened. by the milisecond...sheesh...



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page
   

- Advertisement -