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

Update Random Integer Column

Status
Not open for further replies.

mtepfer

IS-IT--Management
Apr 21, 2003
55
US
Have a table with column that contains random integers. Need to reassign a portion of these integers based on certain criteria. I want to start from s specific number then increase the counter by one. Am working with something like this but when I try to increase the counter it will not allow the where statement.

Declare @lottery As int;
Set @lottery = 293300;

update Table
set table Column A = @lottery + 1
set @lottery = @lottery + 1

WHERE Criteria
 
Never mind figured it out needed to have set statement as follows :

set @lottery = table column a = @lottery + 1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top