I have a table in the database where it contains some of the user name. When I copy the database files from one machine to other machine, I need to manually update this table. The table contains the username in the following format
<domain name>\Username
the domain mostly the local machine name (the user exists within the system). What I am trying to write a simple SQL Query to find a pattern (machine name) and replace with a new one.
I am not so proficient with SQL queries. Can you share a sample snippet? I am using SQL Server 2008
UPDATE table_that_contains_users
SET field_user = replace( field_user, 'OLDDOMAIN\', 'NEWDOMAIN\')
is that?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With