PeterBaileyUk
asked on
sql server query
What s the query syntax to query a table from another db. am currently n a db named ClentData where some tables resse but also want to get to a table n a bd called dctonery(sorry lost a letter on my keyboard)
ASKER
I think this is what you meant but it says it cannot find the object name
use clientdata
go
SELECT * FROM dictionery.[dbo].[TblCurrentWords]
Does your account has permissions to use this database...?
ASKER
yes I have the permissions as I created both dbs
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
As a workaround because maybe something is not as it seems ....go to DevART and download dbForge SQL Complete, v5.5 Express...after you install this you will have intellisense when you are doing queries and it will show you the proper syntax...
ASKER
this worked:
so I guess that proves the permissions
so I guess that proves the permissions
--use clientdata
--go
--SELECT * FROM dictionery.[dbo].[TblCurrentWords]
use Dictionary
SELECT * FROM [dbo].[TblCurrentWords]
How about right clicking your Dictionary database and Refresh
EDIT: have you tried to match exactly the case ...i see Dictionary working but...dictionary is lowercase
maybe your server collation is case sensitive...so lowercase <> uppercase
EDIT: have you tried to match exactly the case ...i see Dictionary working but...dictionary is lowercase
maybe your server collation is case sensitive...so lowercase <> uppercase
ASKER
thank you the tool you suggested got me to the correct 'way'
use ClientData
SELECT * FROM Dictionary.dbo.TblCurrentW ords
use ClientData
SELECT * FROM Dictionary.dbo.TblCurrentW
So i guess it was case sensitive issue...
You just got a typo in your select:
SELECT * FROM dictionery.[dbo].[TblCurrentWords]
Should be 'a' instead of 'e'.
SELECT * FROM dictionery.[dbo].[TblCurrentWords]
Should be 'a' instead of 'e'.
Open in new window
so in your case should beOpen in new window
The schema dbo is just an assumption because its very common...