Solved

Populate SQL table.field with incremental value for unique ID

Posted on 2004-08-19
4
538 Views
Last Modified: 2006-11-17
Hi

I have imported a view from an Oracle database via ODBC driver(Executed via scheduled DTS).  However, I need to insert a key field so I can create an index, then link it to an MS Access interface.  I have added the new field to the imported table (i.e. REPORTS_V_CHK_VW_HOURS).  So what I would like to do know is populate the field with an incremental value (i.e. 1, 2, 3, 4, etc.), so each field is uniquely identified.

I am pretty new to MS SQL and eager to learn.  Help is very much appreciated.  

Thank you in advance

RD
0
Comment
Question by:Russell_Derouin
4 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 11843533
You can do that, by setting the IDENTITY attribute.
0
 

Author Comment

by:Russell_Derouin
ID: 11845516
Hi,

Thanks for the info, but I thought and tried that. I solved my own problem getting means to rebuild the Oracle view (root of my problem).  The view was created incorrectly; hence, duplicate records.  Once the duplicate records are removed, I will be able to apply the Identity attribute from MS SQL.

Thanks for the feedback
0
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
ID: 12142700
Submitted to PAQ with points refunded (75)

DarthMod
Community Support Moderator
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Conditions in Where clause 9 46
point in time restore in SQL server 26 41
SQL Rewrite without the NULLIF 4 25
Freeze portion of datamart 2 21
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…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

713 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