TSQL about more Servers

  • Johan wrote:

    : What happens if you execute that statement separately ?

    : (is the error persistent ?)

    When I run the query directly on the server, then I don't have the error!

    But in both way the numbers of DBs are the same.

    ------------------------------------------------------------------------------

    One error I think is a long name of database:

    Errormessage:

    Msg 102, Level 15, State 1, Line 4

    Falsche Syntax in der Nähe von '-'.

    DB-name:

    SharePoint_AdminContent_c9fef216-4795-41e4-9c38-94d53d77d325

    This isn't in the resultgrid in both way (server, registered server)

    ------------------------------------------------------------------------------

  • mick miller (6/19/2009)


    Johan wrote:

    : What happens if you execute that statement separately ?

    : (is the error persistent ?)

    When I run the query directly on the server, then I don't have the error!

    But in both way the numbers of DBs are the same.

    ------------------------------------------------------------------------------

    One error I think is a long name of database:

    Errormessage:

    Msg 102, Level 15, State 1, Line 4

    Falsche Syntax in der Nähe von '-'.

    DB-name:

    SharePoint_AdminContent_c9fef216-4795-41e4-9c38-94d53d77d325

    This isn't in the resultgrid in both way (server, registered server)

    ------------------------------------------------------------------------------

    I should have thought of this earlier.....

    But your posting of the dbname was a real aha-erlebness 😉

    You should surround the db name with square brackets !

    EXEC sp_MSforeachdb @command1 = ''select name, physical_name, state_desc, size, max_size, growth from [?].sys.database_files

    This way, SQLServer doesn't interpret [SharePoint_AdminContent_c9fef216-4795-41e4-9c38-94d53d77d325]

    like a composed expression SharePoint_AdminContent_c9fef216 - 4795 - 41e4 - 9c38 - 94d53d77d325

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

Viewing 2 posts - 16 through 16 (of 16 total)

You must be logged in to reply to this topic. Login to reply