Solved

sql table alter sql 2005

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
I have a large data set and a SSIS package. How can I load this file in multi threading?
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.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

896 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

11 Experts available now in Live!

Get 1:1 Help Now