| | |
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
| Thread Tools | Search this Thread |
Tag cloud for MySQL
1 agplv3 alfresco api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright court crm data database design developer development distinct dui eliminate email enter enterprise error eudora facebook form foss gnu government gpl greenit groupware hiring hyperic images innerjoins insert ip joebrockmeier join keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb matchingcolumns metron microsoft microsoftexchange montywidenius multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opengovernment opensource operand oracle penelope php query referencedesign reorderingcolumns results resultset saas search select sharepoint simpledb sourcecode spotify statement sugarcrm syntax techsupport thunderbird transparency update virtualization






