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

Modifying a field datatype size

Status
Not open for further replies.

cpuphantom

IS-IT--Management
Jan 8, 2001
58
US
I need help finding the correct sql statement to increase the size of a varchar field in my database. I underestimated the size I would need.

I have tried this:
"alter table tbWeeklyReport modify (q1 varchar(1500), q2 varchar(1500))"

But I get an error near the "(" before "q1"

Is it possible to increase the size of a varchar field? I'd hate to have to delete all this info and start over.

Thanks in advance.
 
Hi

Try this instead:

ALTER TABLE tbWeeklyReport
ALTER COLUMN q1 varchar(1500)
GO
ALTER TABLE tbWeeklyReport
ALTER COLUMN q2 varchar(1500)
GO

You can only change one column at a time when using the alter table statement.

Hope this helps

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top