I want to generate a random number against StudentID, I am using the following SQL
The Result i am getting is :
Please Help.
I want to generate a random number against StudentID, I am using the following SQL
The Result i am getting is :
Please Help.
You're just setting that column to the column index of the partitioned row_number, which is 1. If you want a random number for each row, it would be easier to do this:
UPDATE TAB_EXAM_FORMS
SET RNO_CODE = CAST(RAND(CHECKSUM(NEWID())) * 10 AS INT) + 1
Just change the multiplication to whatever range you want. This range is 1-10.