.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

SQL Server 2005 - Working with IDENTITY column

Posted By: Anusha     Posted Date: November 05, 2009    Points:2   Category :Sql Server
Hi,

I am working on SQL Server 2005 tables. Here I need to add a column named 'ID' as 'IDENTITY' column (With starting and incrementing values as 1, 1).

Now my problem is that these tables already have thousands of records. So could you please suggest the best and easy way to perform this job?

Many Thanks,

Regards.

Anusha.

Responses
Author: Akhil Raj       [Moderator]      
Posted Date: November 05, 2009     Points: 5   

please check the following links..

http://msdn.microsoft.com/en-us/library/aa933196%28SQL.80%29.aspx


http://www.sqlteam.com/article/understanding-identity-columns


http://cavemansblog.wordpress.com/2009/04/02/sql-how-to-add-an-identity-column-to-a-table-with-data/


http://ryanfarley.com/blog/archive/2004/12/19/1313.aspx


Author: Syed Shakeer Hussain             
Posted Date: November 06, 2009     Points: 5   

Hi Anusha,
Check the Below link for Indentity Column in Table:
http://www.dotnetspark.com/kb/647-autoincrement-column-table-using-sqlserver.aspx

Author: sriram             
Posted Date: October 27, 2011     Points: 20   


u can check some condition,taking backup for existing table and to create a table different and same structreue with identity column.

insert into emptable select * from empsalary;


hope this will help
let me know any Queries...

Regards
Sriram.R



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend