Solved

alter size of varchar column, syntax

Posted on 2009-07-07
3
828 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

919 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

14 Experts available now in Live!

Get 1:1 Help Now