Solved

alter size of varchar column, syntax

Posted on 2009-07-07
3
837 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

737 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