Results 1 to 4 of 4

Thread: information_shema cross server?

  1. #1
    Join Date
    Mar 2003
    Posts
    383

    Red face information_shema cross server?

    Hi All:

    When I check out > 2000 customer databases cross 8 SQL 2000 servers, I wish I could use
    "Select * from " + @server + "." + @databaseName + ".information_Schema.coulmns
    where column_name = " + @column_name.

    It did not works in this way.
    However, why it works on
    "Select * from serverA.master.information_schema.columns"?
    It is also a cross server query but is on Master DB.

    thanks
    -D

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Because information_schema views are in master db physically, and don't think you can query that via linked server directly.

  3. #3
    Join Date
    Mar 2003
    Posts
    383

    Cool

    Right now, I have to run the dynamic script within the server,
    but it looks each of the database has its own information_schema which helps me identify the completion of service pack distribution.

    Thus, to cross the server, the only way is to use sysobjects which I want to avoid.

    p.s. is there some properties about information_schema with stored procdure/trigger? In addition, whatelse I could do with the proc with encryption?

    thanks for the info.
    -D

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    You can query information_schema views in user db like run system sp, but they are in master db. Can try create view or sp in target db on linked server then query view or run sp via linked server.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •