Link to home
Start Free TrialLog in
Avatar of bibi92
bibi92Flag for France

asked on

question about statement with linked server

Hello,

I don't want to specify use [db] for execute this query on a user database :
select name
from [servername].dbname.sys.schemas
where schema_id = objectpropertyex(object_id('schema.ACES'), 'SchemaId')

How can do this?

Thanks
bibi
ASKER CERTIFIED SOLUTION
Avatar of sammySeltzer
sammySeltzer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I ran that same query on one of our user databases and all I changed was the dbname to actual user db.

Are you getting an error?

Avatar of bibi92

ASKER

no but with
select name
from [servername].dbname.sys.schemas -- I haven't all schemas for the user db
and when I add the where clause
where schema_id = objectpropertyex(object_id('schema.ACES'), 'SchemaId') the result is null
thanks
bibi

Ok, I see.

What are you trying to accomplish though?
Avatar of bibi92

ASKER

I try to check the count(*) from sources tables for a specific schemas, the target tables contain a column schema.
Thanks
bibi
Avatar of bibi92

ASKER

Thanks regards bibi