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
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! -KrisThis 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
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. -MorganFrom: Kris Shaw <bounce-krisshaw4395@tessituranetwork.com>Sent: 8/18/2009 5:39:21 PMI 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! -KrisThis 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!
From: Kris Shaw <bounce-krisshaw4395@tessituranetwork.com>Sent: 8/18/2009 5:39:21 PM
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...
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 + ''''''';'
IF @@FETCH_STATUS <> 0 BREAK
END
CLOSE c_Tables
DEALLOCATE c_Tables
Thanks, Kevin! I'll give it a try...