473,566 Members | 2,785 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Add an Auto-Increment Field With a Unique Name

1 New Member
Hi every body!

I have a code:
Expand|Select|Wrap|Line Numbers
  1. ALTER TABLE archive ADD ID int IDENTITY(1,1) PRIMARY KEY
but when i running, i'm alway get an error:
Expand|Select|Wrap|Line Numbers
  1. Column names in each table must be unique. Column name 'ID' in table 'archive' is specified more than once.
  2.  
So how to fix this problem.

Thanks all for help me!
May 2 '12 #1
2 1846
yarbrough40
320 Contributor
Naming your column something else should do the trick ( that error message is not all that cryptic)
May 2 '12 #2
ck9663
2,878 Recognized Expert Specialist
It means you already have a column named ID in your table. Use another name.

Happy Coding!!!


~~ CK
May 4 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

36
11297
by: Martin Herrman | last post by:
Dear scripters, I am working on a HTML form in which a date must be entered of the form 'dd-mm-yyyy'. Now I'm looking for a script that, when the user switches to another form field, changes e.g. 'ddmmyyyy' or 'dd-m-yy' to 'dd-mm-yyyy'. I have searched the net using google, but only found validators that show an error if an incorrect...
7
2228
by: jballard | last post by:
Hello, I have a database set-up with a form and two subforms in it. I have one of the subforms (replacement parts) set-up where you can pick part numbers from a drop down box and also pick a description of the part from a drop down box. These are two separate fields. I want to be able to pick the part number and have it put in the...
2
5730
by: Kevin | last post by:
Thanks for the very quick response posting that I can use a memo datatype to store large amounts of text. I understand that I can turn on "Can Grow" for a memo type, but is there either a property or VB code that will allow the text box to expand vertically as the user adds lines, so that it isn't necessary to use the vertical scroll bar to...
2
1676
by: sukatoa | last post by:
Good day, Im new to JavaScript and would like also to learn Ajax by having experiments and to apply directly to an application(Hope this could also be effective) Now, i will attempt to conduct an experiment about the interaction on Yahoo's search field.....(Auto suggest) This will use Ajax in real, but i wan't that first to implement...
3
2509
by: Puzzled and Confused | last post by:
It seems like a simple request, but I cannot get it to work. Does anyone know to how to make data from one field auto populate in another field, only if the answer is yes/true? I have a form that I would like the exact data, which varies, to auto populate only after an update to yes. A toggle button is to answer the field, but I would like for the...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8108
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7644
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1201
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.