Solved

alter size of varchar column, syntax

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

770 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