Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need a function to update a table

Status
Not open for further replies.

mague4718

Programmer
Jan 8, 2002
7
US


I just graduated and am new to SQL so any (detailed) help would be appreciated. Thanks
I have a customers table such as this:

Customers
---------

CustomerID FirstName LastName MI
3748 Margarita Perez B

I also have a function that given the above information will generate a string such as: MBP3748

I want this new value to replace the old CustomerID (3748)

I have some data entry people who are just going to enter the FirstName,LastName and MI info and I want to have the CustomerID as an autonumber (not sure how to do that either)
Once they have entered the info for one person,I want that function/script to run and update the Primary ID and then they can enter info for the next person. Is there any way to do this?
 
Have a look in BOL under the topic "IDENTITY (Property) (T-SQL)". This will do your auto number.

Rick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top