Click here to Skip to main content
14,326,421 members
Rate this:
Please Sign up or sign in to vote.
See more:
We have a challenge some one run sql script to update username on the database against master db now all the username on the master db have one common username.
Can someone please Help us we want to Update username column in the master database by selecting username from another database in XAUser table below is script that I tried but am struggling with update part to the master db.

What I have tried:

User master

select X.UserID,X.UserInit

from DBLive.[dbo].XaUser X

update master
set UserInit = UserInit
where UserID = X.UserID
Updated 4 days ago
Richard MacCutchan 4 days ago
Why not just reload from your backup? Oh, and also sack the person who corrupted the master.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

A proper statement is:
    Table_A.col1 = Table_B.col1,
    Table_A.col2 = Table_B.col2
    Some_Table AS Table_A
    INNER JOIN Other_Table AS Table_B
        ON =
    Table_A.col3 = 'cool'

For further details, please see: How do I UPDATE from a SELECT in SQL Server? - Stack Overflow[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100