Linked SQL Server database giving “inconsistent metadata” error

前端 未结 3 1605
你的背包
你的背包 2020-12-31 05:47

I am currently running a third-party software suite, which uses SQL Server as its database. I have a second instance of SQL Server running in a different location, and some

相关标签:
3条回答
  • 2020-12-31 06:07

    I solved this with this steps

    1) Step 1:

    • In SQL Server Management Studio open Linked Servers and then 'New Linked Server'.

    • Inside of appeared wizard – Select the General tab.

    • Specify alias name in "Linked server" field.

    • Select SQL Native Client as provider.

    • Add sql_server in "Product Name" field (that's the magic).

    • In "Data Source" – specify name of the host to be used as linked server.

    2) Step 2:

    • In Security tab – specify proper security options (e.g. security context)

    3) Step 3:

    • In Server Options tab – put "Data Access", RPC, "Rpc Out" and "Use Remote Collaboration" to be true.

    4) Step 4:

    • Enjoy.

    http://alexpinsker.blogspot.com.br/2007/08/how-to-give-alias-to-sql-linked-server.html

    0 讨论(0)
  • 2020-12-31 06:23
    Server: Msg 7356, Level 16, State 1, Line 1 
    
    OLE DB provider 'MSDASQL' supplied inconsistent metadata for a column. 
    Metadata information was changed at execution time.
    

    If you use a four-part name syntax to query the data from the linked server database, you may receive this error message. To work around this problem, you can use the OPENQUERY syntax to query the data from the linked server database. You can turn on trace flag 7300 to receive more detailed information about this error message. To turn on trace flag 7300, run the following Transact-SQL statement:

    DBCC TRACEON(7300)
    
    0 讨论(0)
  • 2020-12-31 06:25

    I've had this happen a few times. The one workaround I found was to use OPENQUERY.

    SELECT * FROM OPENQUERY(LinkedServerName, 'SELECT * FROM DBName.Schema.Table')
    

    Also, the select you posted above has an incorrect 4 part name (could just be a typo but I wasn't sure). It should be LinkedServerName.DBName.SchemaName.TableName

    0 讨论(0)
提交回复
热议问题