Solved

Populate SQL table.field with incremental value for unique ID

Posted on 2004-08-19
4
537 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Live Storage Vmotion VMs with shared VMDK 10 56
SSRS 2013 - Overlapping reports 2 20
2016 SQL Licensing 7 40
SQL Querying data from 3 tables, all with 1 common column 4 34
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

776 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