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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stored procedure

Status
Not open for further replies.

cgj

IS-IT--Management
May 21, 2001
4
US
I am trying to generate a stored procedure, or set of stored procedures, to generate a userid. I am taking an existing employee number in the database, performing a looped alogrythm that generates a new employee #, and updating the record with that number.

The stored procedure works when I set the variable @number to a constant. (select @number = 55555) It does not work, however, when I try to pull @number from a column in the database. (select @number = [column]) I want this stored procedure to update the id field for all records in the database.

How do I have the stored procedure pull this existing value in and go through all records in the database to perform the calculation and update the record.

I don't know what syntax to use to assign a column value to the variable. Any help would be really really appreciated!

Thanks.
cgj


create procedure [empid]
 
Hi,
I have a table with a variable number of rows composed of key, counter and one column containing a text. I need to concatenate the text for all the rows that have the same key so that the results is one row only with the text concatenated.

Sorry for my english.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top