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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Alter Table Data Types 1

Status
Not open for further replies.

surfbum3000

Technical User
Aug 22, 2003
156
US
I have a table that needs multiple column data types changed to text. I am using this code that works:

ALTER TABLE tbl6DaysSERVICES
ALTER ID text

The downside is I have to create a seperate query for each column to change each data type. I have tried:

ALTER TABLE tbl6DaysSERVICES
ALTER ID text, CLIENT_ID text, UNIT_ID text;

But this fails with a syntax error.
 
Perhaps you could set up the alter table in code with a variable and then loop through changing the value of each field? You could also try searching the forum for code to list the fields in your table and then you could use that to loop through a recordset to modify your alter table field for each item.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top