Solved

sql table alter sql 2005

Posted on 2011-02-17
4
250 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 125 total points
ID: 34923785
ALTER TABLE xyz ALTER COLUMN qty INT NULL
0
 
LVL 23

Assisted Solution

by:Rajkumar Gs
Rajkumar Gs earned 250 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 125 total points
ID: 34923804
0
 
LVL 23

Assisted Solution

by:Rajkumar Gs
Rajkumar Gs earned 250 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
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.

758 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

23 Experts available now in Live!

Get 1:1 Help Now