| | |
Help with generating a unique number
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Aug 2009
Posts: 9
Reputation:
Solved Threads: 0
hello,
I'm trying to create a database in SQL Server management Studio for a project. I have created a tabel named Employee and I have 14 columns. I need to set the firts column (Emp_ID) as Primary Key (accomplished) and then generate a unique number for each Emp_ID that I insert. currently I have no information in my database I'm stuck in finding the procedure to correctly code the SQL statement that will generate a unique Emp_ID when I insert new values or add a new row of information. Can someone please help? I"ve look all over my text and searched the web and cannot find something useful to help.
thanks in advance
I'm trying to create a database in SQL Server management Studio for a project. I have created a tabel named Employee and I have 14 columns. I need to set the firts column (Emp_ID) as Primary Key (accomplished) and then generate a unique number for each Emp_ID that I insert. currently I have no information in my database I'm stuck in finding the procedure to correctly code the SQL statement that will generate a unique Emp_ID when I insert new values or add a new row of information. Can someone please help? I"ve look all over my text and searched the web and cannot find something useful to help.
thanks in advance
0
#2 Oct 8th, 2009
sql Syntax (Toggle Plain Text)
CREATE TABLE Employee ( Emp_Id INT PRIMARY KEY IDENTITY, LastName VARCHAR(255) NOT NULL, FirstName VARCHAR(255), Address VARCHAR(255), City VARCHAR(255), postalcode vachar(6), /* other columns*/ )
Last edited by almostbob; Oct 8th, 2009 at 12:35 am.
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
![]() |
Similar Threads
- need help on generating random number? (PHP)
- java code to find lowest and unique number from aray (Java)
- Generating a unique sudoku (C++)
- Generating unique filenames (VB.NET)
- Generating a Random Number (C#)
- Logic behind generating random number (C)
Other Threads in the MySQL Forum
- Previous Thread: how to create table relate with other table
- Next Thread: Trouble using ORDER BY in a UNION statement
Views: 394 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for MySQL
"use" 1 agplv3 alfresco amazon api artisticlicense aws bizspark changingprices communityjournalism contentmanagement contractors copyright count crm data database design developer development distinct drupal dui ec2 eliminate email enter enterprise error facebook form foss gartner gnu government gpl greenit groklaw groupware hiring hyperic images innerjoins insert ip join journalism keyword kickfire laptop legal license licensing linux maintenance mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource operand oracle pdf penelope php priceupdating query referencedesign remove saas search select sharepoint simpledb sourcecode spotify sql statement sugarcrm techsupport thunderbird update virtualization






