Stopping a Batch from running. 207 errors (invalid column) occuring

  • I am not sure where to post this, so if not here maybe someone can refer me elsewhere, thx.

    When an out of domain user connects (successfully) I get 207 errors saying Invalid column names when the user opens the databases folder in mangement studio object explorer.

    The invalid columns are mirroring_role and mirroring_state.

    Is this batch suppose to run at startup ? How do I disable it ?

    Here is what runs when the error message appears:

    SELECT

    dtb.name AS [Database_Name],

    'Server[@Name=' + quotename(CAST(serverproperty(N'Servername') AS sysname),'''') + ']' + '/Database[@Name=' + quotename(dtb.name,'''') + ']' AS [Database_Urn],

    case

    when DATABASEPROPERTY(dtb.name,'IsShutDown') is null then 0x200

    else 0

    end |

    case

    when 1 = dtb.is_in_standby then 0x40

    else 0

    end |

    case

    when 1 = dtb.is_cleanly_shutdown then 0x80

    else 0

    end |

    case dtb.state

    when 1 then 0x2

    when 2 then 0x8

    when 3 then 0x4

    when 4 then 0x10

    when 5 then 0x100

    when 6 then 0x20

    else 1

    end

    AS [Database_Status],

    dtb.compatibility_level AS [Database_CompatibilityLevel],

    dtb.mirroring_role AS [Database_MirroringRole],

    coalesce(dtb.mirroring_state + 1, 0) AS [Database_MirroringStatus],

    dtb.recovery_model AS [RecoveryModel],

    dtb.user_access AS [UserAccess],

    dtb.is_read_only AS [ReadOnly],

    dtb.name AS [Database_DatabaseName2]

    FROM

    master.sys.databases AS dtb

    WHERE

    (CAST(case when dtb.name in ('master','model','msdb','tempdb') then 1 else dtb.is_distributor end AS bit)=0 and CAST(isnull(dtb.source_database_id, 0) AS bit)=0)

    ORDER BY

    [Database_Name] ASC

    Any help is much appreciated, Thanks!

  • Ignore this. The users had the April CTP client on their desktop and that appears to cause this error.

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

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