Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

sql table alter sql 2005

Posted on 2011-02-17
4
Medium Priority
?
264 Views
Last Modified: 2012-05-11
i need modify a data type from bit to int how can i modify.

table name is xyz id is primary key and qty is bit i want to modify from bit to int.
0
Comment
Question by:romeiovasu
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
mcv22 earned 500 total points
ID: 34923785
ALTER TABLE xyz ALTER COLUMN qty INT NULL
0
 
LVL 23

Assisted Solution

by:Rajkumar Gs
Rajkumar Gs earned 1000 total points
ID: 34923786
Execute this query
alter table xyz 
  alter column qty  int

Open in new window


Also you can modify it through Microsoft SQL Server Management Studio GUI
0
 
LVL 39

Assisted Solution

by:Pratima Pharande
Pratima Pharande earned 500 total points
ID: 34923804
0
 
LVL 23

Assisted Solution

by:Rajkumar Gs
Rajkumar Gs earned 1000 total points
ID: 34923836
Alternative way using Microsoft SQL Management Studio (If it is available)

1. Open Microsoft SQL Management Studio
2. Login with your valid credentials
3. Expand 'Databases'
4. Expand '<YourDatabase>'
5. Expand 'Tables'
6. Right-Click on the table you want to modify
7. Select 'Modify' from the Right-Click menu
8. Here you can see the table design in editable mode. Click on the datatype and select int instead of bit
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Ready to get certified? Check out some courses that help you prepare for third-party exams.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

927 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