Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing data type

Status
Not open for further replies.

ptrifile

Technical User
Aug 10, 2004
457
US
Can someone please tell me if there is an automated way like using a macro to change data types in a table? Any help or suggestions welcome!!

Thank you!

Paul
 
ptrifile,

Okay how this??

ALTER TABLE Employees ALTER COLUMN Emp_Email TEXT(50)

Unfortunatly you will have to create a VBA module and then call it from your macro.

Hope this helps..

Good Luck...


 
ptrifile,

Actually you may be able to do a RUNSQL (marco action) and use the ALTER TABLE statement. NOTE: I have not tested this.

Just and idea.

Good Luck...

 
Thanks HitechUser! This does get the job done, however, I dont really know SQL all that well and when I used your first suggestion it worked, but I cant seem to get it to do more than one field, if i add another statement to change another field i get the following error: "Syntax error in ALTER TABLE statmement". If I wanted to change 2 different fields how should the statement read? Thanks for all your help!!!

Paul
 
ptrifile,


Hmmm.. Why not just do multiple ALTER TABLE statements??

If you are, then you may not be terminating your SQL statement. Is the an ";" (without quotes) at the end of the each statement?

Let me know..

Good Luck...


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top