Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: altering multiple columns


Message #1 by "Dong G. Lee" <sdnbaby@h...> on Fri, 21 Sep 2001 19:15:30
Thank you for your response.
I know I can do this with EM, and actually I did the couple of tables with 
it. 
But since I need to modify about 20 tables and the changes are pretty much 
the same, I'm trying to write the codes to do this at once. So, It does 
not have to be done via code but I think using code is the better way of 
doing it, especially with having two more Access databases upgraded to 
SQLServer.    

> Why not use Enterprise Manager to do the alterations?
> Do you have Access 2000? If so, set up a project file (.ADP) to the new
> database and you can use Access to modify the SQL tables..
> 
> Or does this *have* to be done via code?
> 
> -- Tomm
> 
> > -----Original Message-----
> > From: Dong G. Lee [mailto:sdnbaby@h...]
> > Sent: Friday, September 21, 2001 7:16 PM
> > To: sql language
> > Subject: [sql_language] altering multiple columns
> >
> >
> > Hi,
> >
> > I have imported Access database to SQL2000, and I'm trying to alter the
> > data types and adding identity to an id column.
> > I have two questions.
> > 1. Is there any way to alter multiple columns in one quer? For
> > example, if
> > I run a query like
> >
> > 	alter table tblTest
> > 		alter column TestID int,
> > 			TestName varchar(10)
> > This gave me error message. Does this mean the syntax is wrong or 
there is
> > no way to alter multiple columns?
> >
> > 2. What's the syntax to change TestID column to be an IDENTITY?
> >
> > I've looked a couple of books and BOL, but could not find the
> > answer. Thank
> > you for reading this. Looking forward to your response.
> >
> > Dong.
> >
> 

  Return to Index