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.
| Author |
Topic |
|
ConnieXujuan
Starting Member
48 Posts |
Posted - 2011-12-22 : 18:32:54
|
| Hi there,It is querying the same table. I logged in SQL server using windows login, and connected to a local instance (serverA) as well as another server instance (serverB); however, when I was running query: SET NOCOUNT ON SELECT * FROM master.sys.database_principals WHERE type IN ('U') on the local instance it gave me correct answer; but if I run query: exec xp_cmdshell 'sqlcmd -S "ServerA" -Q "SET NOCOUNT ON SELECT * FROM master.sys.database_principals WHERE type IN (''U'')" -s "|" -W'from the other instance (ServerB) I was connected to, it gave me a different answer.anyone knows why that happend?Thanks a lot!!!!Connie |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|