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.
Author |
Topic |
mparker
Starting Member
1 Post |
Posted - 2008-12-08 : 16:31:57
|
I have a primary key in an existing table which is populated. The PK was previously integer, auto-incrementing identity. I would like to change the type to be a varchar(50). Can someone help me on the t-sql script i could use to do this? I do not want to do this through the enterprise manager gui. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-09 : 03:22:59
|
why do you want PK to be varchar? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-09 : 13:02:05
|
nope. i was asking reason behind changing PK from identity column to varchar column. An integer identity column would have been much better choice for PK as they are fast to index, fast and convenient in joins with foreign keys.Also they will require minimal effort to maintain due to the as they are autoincrementing. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|