Change User ID

I have a user who would like to have their User ID changed to reflect a change in their last name.

Is User ID a unique/primary key and/or will changing it having any long term consequences? Or is it merely a user attribute?

Thanks!

-Kris

  • Former Member
    Former Member $organization
    User id is used in all sorts of places to tag who did what, but also in some places to mark ownership. Changing it is not a good idea, because that would break all those links to the history.
    Best thing to do is to create a new id and inactivate the old one, then update the tables where it's used to flag ownership. Lists and report schedules are the ones that leap to mind, but there may be others. If you use solicitations you might want to update those, for example, to keep the user's activities together for reporting.

    Ken McSwain
    +61 (0)418 659 360
    Sent from BlackBerry
    Please consider the environment before printing this email.
    =====This message is intended for the addressee(s) named and may contain confidential information.
    If you are not the intended recipient, please delete it and notify the sender.
    Views expressed in this email are those of the individual sender and are not necessarily the views of the Sydney Opera House Trust=====
  • Former Member
    Former Member $organization
    Hi.  Solicitations, ticklers (and maybe scheduled reports?) might be of interest here--if used--but best practice most likely to be inactivating the old account and adding same security usergroups to a replacement account. 

    On Aug 18, 2009, at 6:40 PM, "Kris Shaw" <bounce-krisshaw4395@tessituranetwork.com> wrote:

    I have a user who would like to have their User ID changed to reflect a change in their last name.

    Is User ID a unique/primary key and/or will changing it having any long term consequences? Or is it merely a user attribute?

    Thanks!

    -Kris




    This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Technical Forum. You may reply to this message to post to the Technical forum or visit the site to search, read and post to the forums. In the interest of keeping the forum posts from becoming cluttered, we encourage you to delete previous message text from your reply before sending. Thank you!
  • Isn't the "user ID" a number? What's the connection between that and the customer's last name? Did you mean to say their "login ID"? (The one they use to login online.) You should be able to change that with no ill effects.

       -Morgan

  • Former Member
    Former Member $organization in reply to Morgan L'Argent (Past Member)
    I believe Kris is referring to a Tess user (client) login but maybe I have that wrong.

    On Aug 18, 2009, at 11:30 PM, "Morgan L'Argent" <bounce-morganlargent2717@tessituranetwork.com> wrote:

    Isn't the "user ID" a number? What's the connection between that and the customer's last name? Did you mean to say their "login ID"? (The one they use to login online.) You should be able to change that with no ill effects.

       -Morgan

    From: Kris Shaw <bounce-krisshaw4395@tessituranetwork.com>
    Sent: 8/18/2009 5:39:21 PM

    I have a user who would like to have their User ID changed to reflect a change in their last name.

    Is User ID a unique/primary key and/or will changing it having any long term consequences? Or is it merely a user attribute?

    Thanks!

    -Kris




    This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Technical Forum. You may reply to this message to post to the Technical forum or visit the site to search, read and post to the forums. In the interest of keeping the forum posts from becoming cluttered, we encourage you to delete previous message text from your reply before sending. Thank you!
  • Yes, Sorry, I should have clarified that I meant the user logon that is list in the column of Tess Security as "User ID".

    Thanks for the thoughts on this, I think I will go the inactivation route...

    -Kris

  • Hey Kris,

    If you're SQL savvy or have a DBA at your disposal, I created an SQL script for doing this.  We had a few users who got married and wanted to change their name, and we wanted to keep all their actions in Tessitura tied to their new account.  It searches the database for any table with the standard username columns and generates UPDATE statements to make the username changes (I did it this way so I could test the update statements manually in our test database first, rather than just having it auto-change everything.)  The script is below.  Definitely test this in a non-production database first!  So far it's worked pretty good for us, however I've not run this since we've upgraded to Tessitura 9.

    Kevin.

     

    DECLARE c_Tables CURSOR FOR (

          SELECT DISTINCT table_name, column_name

          FROM INFORMATION_SCHEMA.columns

          WHERE column_name IN ('userid', 'created_by', 'last_modified_by')

          AND (table_name LIKE 'T%' OR table_name LIKE 'L%')

    )

     

    DECLARE @Table_Name VARCHAR(255)

    DECLARE @Column_Name VARCHAR(255)

    DECLARE @Username_Old VARCHAR(10)

    DECLARE @Username_New VARCHAR(10)

    DECLARE @SQL VARCHAR(4000)

    DECLARE @RC INT

     

    SET @Username_Old = 'oldusername'

    SET @Username_New = 'newusername'

     

    OPEN c_Tables

    FETCH NEXT FROM c_Tables INTO @Table_Name, @Column_Name

     

    WHILE @@FETCH_STATUS = 0

    BEGIN

          EXEC (

                'DECLARE @RC INT;' +

                'SELECT @RC=COUNT(*) FROM ' + @Table_Name + ' WHERE ' + @Column_Name + ' = ''' + @Username_Old + ''';' +

                'IF @RC > 0 PRINT ''UPDATE ' + @Table_Name + ' SET ' + @Column_Name + ' = ''''' + @Username_New + ''''' WHERE ' + @Column_Name + ' = ''''' + @Username_Old + ''''''';'

          )

          FETCH NEXT FROM c_Tables INTO @Table_Name, @Column_Name

          IF @@FETCH_STATUS <> 0 BREAK

    END

     

    CLOSE c_Tables

    DEALLOCATE c_Tables

     

  • Thanks, Kevin! I'll give it a try...

    -Kris