Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 changing column data type in sql

Author  Topic 

subhaoviya
Posting Yak Master

135 Posts

Posted - 2009-10-22 : 00:34:44
i have one table which the first field name is Field_ID having primary key and identity increment by 1. its data type is int
i want to change the datatype as varchar(10).

after removing primary key, i cant able to change the datatype.

how to overcome this problem?

thanks
subha

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-10-22 : 01:14:22
quote:
Originally posted by subhaoviya

i have one table which the first field name is Field_ID having primary key and identity increment by 1. its data type is int
i want to change the datatype as varchar(10).

after removing primary key, i cant able to change the datatype.

how to overcome this problem?

thanks
subha




Hi Subha,

Drop the identity property and alter the column.

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-10-22 : 12:51:12
why do you want to make ID column varchar type? will it ever store character data?
Go to Top of Page
   

- Advertisement -