function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Aman Chauhan 5Aman Chauhan 5 

Names corresponding to each OwnerID

Hi All,

I need to find out the Names Corresponding to each OwnerID in the SQL server database.
​Whoch table I should use to gte the desired results? 
Best Answer chosen by Aman Chauhan 5
RaidanRaidan
What is the table name for Salesforce User object? If it is named as User, perhaps you will need to put the square brackets around it, like [User].

All Answers

RaidanRaidan
You will have to download the User table and match the ID with the OwnerID.
Aman Chauhan 5Aman Chauhan 5
Thanks! I was able to do that. But there is no way to join User table with opportunity table?
RaidanRaidan
If you want to join the tables based on the owner then you can do an INNER JOIN.

FROM Opportunity o
INNER JOIN User u ON u.ID = o.OwnerID
Aman Chauhan 5Aman Chauhan 5
I just tried to display the User table using the select * from dbo.user
it is throwing me the following error-

Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'User'.
RaidanRaidan
What is the table name for Salesforce User object? If it is named as User, perhaps you will need to put the square brackets around it, like [User].
This was selected as the best answer
Aman Chauhan 5Aman Chauhan 5
Yup it worked Thanks a ton!!
RaidanRaidan
Please mark the answer to help others who have the same question. Thanks!