Solved

sql table alter sql 2005

Posted on 2011-02-17
4
252 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

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…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

777 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