Geeks Talk

Prepare for your Next Interview




how to alter normal column to identitycolumn

This is a discussion on how to alter normal column to identitycolumn within the SQL Server forums, part of the Databases category; I have existing table it has two columns one column datatyps is int i want to alter that int column to identity colum now i have datain that table how ...


Go Back   Geeks Talk > Databases > SQL Server

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 05-28-2008
Junior Member
 
Join Date: Mar 2008
Location: hyderabad
Posts: 11
Thanks: 0
Thanked 1 Time in 1 Post
boreddy is on a distinguished road
how to alter normal column to identitycolumn

I have existing table it has two columns one column datatyps is int
i want to alter that int column to identity colum
now i have datain that table
how this is possible to alter to identity column
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-28-2008
Junior Member
 
Join Date: Oct 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
AM_GEEK is on a distinguished road
Re: how to alter normal column to identitycolumn

There is no way to modify the identity property of a column through scripts.
You can try doing it from enterprise manager and generate the change scripts it follows the steps as below

- create a tmp table with same design
- transfer data to the tmp table from original table
- drop the original table
- create with new specs and
- retransfer data with identity of
- switch on the identity

however do ensure that the column you want to change to identity has no nullls and duplicates

Regards
AM
Reply With Quote
  #3 (permalink)  
Old 07-18-2008
Junior Member
 
Join Date: Jun 2008
Location: Banglore
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
kumar2ch is on a distinguished road
Re: how to alter normal column to identitycolumn

just u go to the SqlEnterprisemanager-> and select the Database and one of the table(Ex:EmployeeTabel) select and modify u select the one colum and regradeing columns Details Populated in the footer and selected (select Deptno Column) and set one of option is Seed and give some number that's why we can change the exsting column constraint
Reply With Quote
Reply

  Geeks Talk > Databases > SQL Server


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
Normal View, Materialised View and Bitmap Index Geek_Guest Oracle 3 05-27-2008 11:59 PM
What is the difference between Normal mode and Fast mode? suneetham QTP 4 03-28-2008 02:25 AM
How to alter a type in SQL Geek_Guest SQL 8 02-06-2008 02:51 AM
How to alter the primary column lekhrajdeshmukh SQL 2 02-05-2008 07:07 AM
Restrictions with Alter command fred SQL 3 09-03-2007 11:35 PM


All times are GMT -4. The time now is 08:46 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved