•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 373,930 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,272 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:
Views: 3068 | Replies: 2
![]() |
•
•
Join Date: Aug 2007
Posts: 98
Reputation:
Rep Power: 1
Solved Threads: 0
Hi guys!
I am developing a web based database for a company for my year work placement for university. As I'm still a student I am still learning so I am not 100% on what i am doing. I was wondering if someone could provide me with some help?...please!
The company wants a database that will contain all the equipment that they sell and the customers etc. The customers and equipment already have id numbers. How do I enter the Id numbers that the customers and equipment already have into the database so I dont have to provide them with new ones and still automatically generate numbers for new customers or equipment??
I was going to declare that the field auto generate all the Id numbers before I realised that the customers already have Id numbers. Can I insert my own numbers (the exsiting id's) but still declare the field to auto generate for new customers and equipment?
Any ideas would be appreciated! Thanks!!!
GLT
I am developing a web based database for a company for my year work placement for university. As I'm still a student I am still learning so I am not 100% on what i am doing. I was wondering if someone could provide me with some help?...please!

The company wants a database that will contain all the equipment that they sell and the customers etc. The customers and equipment already have id numbers. How do I enter the Id numbers that the customers and equipment already have into the database so I dont have to provide them with new ones and still automatically generate numbers for new customers or equipment??
I was going to declare that the field auto generate all the Id numbers before I realised that the customers already have Id numbers. Can I insert my own numbers (the exsiting id's) but still declare the field to auto generate for new customers and equipment?
Any ideas would be appreciated! Thanks!!!
GLT
•
•
Join Date: Feb 2005
Location: Braintree, UK
Posts: 1,161
Reputation:
Rep Power: 7
Solved Threads: 58
SET IDENTITY_INSERT <tablename> ON
Place this statement before your insert statement, it allows you to enter specific id's into an identity seed column. Place this line immediately after your insert statement.
SET IDENTITY_INSERT <tablename> OFF
New id's will continue to be generated for new inserts.
I am assuming there will be a one time insert of existing customers and equipment from some other legacy system? If this is going to be a bolt on to an existing system, then you don't need to generate new id's they are already being generated so you just need a unique index.
Place this statement before your insert statement, it allows you to enter specific id's into an identity seed column. Place this line immediately after your insert statement.
SET IDENTITY_INSERT <tablename> OFF
New id's will continue to be generated for new inserts.
I am assuming there will be a one time insert of existing customers and equipment from some other legacy system? If this is going to be a bolt on to an existing system, then you don't need to generate new id's they are already being generated so you just need a unique index.
Last edited by hollystyles : Oct 15th, 2007 at 5:20 am.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb MS SQL Marketplace
- Random Numbers on button (Java)
- C++ Random Numbers (C++)
- Program will not generate random numbers (C++)
- Generate User ID (PHP)
- Trying to find a better way to generate random numbers in Dev Pascal (Pascal and Delphi)
- Encryption of numbers.... (C)
Other Threads in the MS SQL Forum
- Previous Thread: insert to multiple table
- Next Thread: Complex Nested Selects



Linear Mode