Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 users for databases and servers

Author  Topic 

ConnieXujuan
Starting Member

48 Posts

Posted - 2011-12-13 : 21:02:38
HI -,
I was just wondering what could be the problem the running results are dofferent when I was querying sys.database_principals table locally from when I was querying sys.database_principals table remotely from another server?

Many thanks!

Connie

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-12-13 : 23:17:24
were you use same credentials to connect using both methods?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

ConnieXujuan
Starting Member

48 Posts

Posted - 2011-12-13 : 23:52:44
Hi there,

Yeah, i was using the same credential.

basically what I did was to go to SQL server management studio and connect to those two servers. I used 'sqlcmd' command....could that be the problem?

Thanks a lot!

Connie
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-12-14 : 00:00:05
what change you noticed in results?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

ConnieXujuan
Starting Member

48 Posts

Posted - 2011-12-14 : 00:28:33
if I run it remotely there is one more user than it was run locally....
Go to Top of Page

pnash
Starting Member

26 Posts

Posted - 2011-12-14 : 16:13:40
Can you please post your sqlcmd command? for better understand.
Go to Top of Page

ConnieXujuan
Starting Member

48 Posts

Posted - 2011-12-14 : 20:52:53
exec xp_cmdshell 'sqlcmd -S "ServerA" -Q "SET NOCOUNT ON SELECT * FROM master.sys.database_principals WHERE type IN (''S'')" -W -h-1'

was the one running from another server;

SET NOCOUNT ON SELECT * FROM master.sys.database_principals WHERE type IN ('S')

was the one ran locally.
Go to Top of Page
   

- Advertisement -