Solved

alter size of varchar column, syntax

Posted on 2009-07-07
3
825 Views
Last Modified: 2012-05-07
The attached code returns:

Unclosed quotation mark after the character string 'ALTER COLUMN expanded [varchar(1024)]'.

web_site.expanded is currently a varchar(10), I want to be able to convert it to varchar(1024). The column doesn't contain any data at the time I'm trying to do this. Thanks!
ALTER TABLE web_site [ALTER COLUMN expanded [varchar(1024)]]

Open in new window

0
Comment
Question by:bbdesign
3 Comments
 
LVL 17

Accepted Solution

by:
pssandhu earned 500 total points
ID: 24793364
Try this:
ALTER TABLE web_site 

ALTER COLUMN expanded varchar(1024)

Open in new window

0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24793440
it is good to use two part name like schemaname.tablename, assuming your schema is DBO.

ALTER TABLE dbo.web_site
ALTER COLUMN dbo.web_site.expanded varchar(1024)

0
 

Author Comment

by:bbdesign
ID: 24793557
Works great, thanks!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now