update a table without primary key

  • I'm in situation I need to mask data for testing purpose and table do not have primary key to use cursor to increment the value . For example student table below I need to mask. I'm looking for logic to mask as below

    OPEN c_table

    FETCH NEXT FROM c_table INTO @table_counter

    WHILE @@fetch_status = 0

    BEGIN

    UPDATE student

    set class_id = "1234" so next row will be 1235 ....

    studnet_id =

    ssn =

  • Hi,

    Could you provide the table Design along with DataTypes to understand better

    Regards,

    Rajesh

  • Please don't cross post. It just wastes people's time and fragments replies.

    Direct replies to the following thread please:

    http://www.sqlservercentral.com/Forums/Topic505786-8-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply