Home Forums SQL Server 2008 SQL Server Newbies How to switch ID number to new values (but maintaining duplicates for new ones) RE: How to switch ID number to new values (but maintaining duplicates for new ones)

  • would doing something like selecting a newid() help?

    for example, have them do something like this:

    SELECT

    NEWID() AS RefID,

    OtherColumnsButNotTheRealID

    Into TableForExport

    From tblPatients

    --OR

    SELECT

    identity(int,1,) AS RefID,

    OtherColumnsButNotTheRealID

    Into TableForExport

    From tblPatients

    then have them send you the TableforExport, which would not have the sensitive column.

    they could do the same for patient names as well, if they needed to...just select a number instead of a patient name.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!