none
OPENDATASOURCE :Msg 7320, Level 16, State 2, Line 2

    Question

  • I trying to execute the following query in SQL SERVER 2008 R2 64 Bit: SELECT * FROM OPENDATASOURCE('SQLNCLI', 'Data Source=WILSAP01\CitectHistorian;Persist Security Info=False;User ID=sa;Password=XXXXXXX').Willunga_Data.dbo.NumericSamples as LH Where LH.TagID=33518 AND (LH.SampleDateTime >= dbo.ToBigInt('2013-04-12 14:00:00.000')) AND (LH.SampleDateTime <= dbo.ToBigInt('2013-04-22 14:00:00.000'))

    but i get the following error: 

    Msg 7320, Level 16, State 2, Line 2
    Cannot execute the query "SELECT "Tbl1001"."TagID" "Col1003","Tbl1001"."SampleDateTime" "Col1004","Tbl1001"."SampleValue" "Col1005","Tbl1001"."QualityID" "Col1006" FROM "Willunga_Data"."dbo"."NumericSamples" "Tbl1001"" against OLE DB provider "SQLNCLI10" for linked server "(null)". 

    I have enabled the ADHOC queries still it's not working. Any help would be much appreciated. 

    thanks in advance

    -Arun Sahani

    Thursday, May 02, 2013 7:26 AM

Answers

  • Hi All,

    Thanks for those replies. the issue was finally resolved after enabling the " Allow Inprocess" under the SQLNCLI10 properties in the Linked servers.

    -Arun Sahani

     

    • Marked as answer by Arun Sahani Monday, May 06, 2013 2:42 AM
    Monday, May 06, 2013 2:42 AM

All replies

  • So what happens if you run the query

    SELECT "Tbl1001"."TagID" "Col1003","Tbl1001"."SampleDateTime"
    "Col1004","Tbl1001"."SampleValue" "Col1005","Tbl1001"."QualityID" "Col1006"
    FROM "Willunga_Data"."dbo"."NumericSamples" "Tbl1001"

    directonly WILSAP01\CitectHistorian?


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    Thursday, May 02, 2013 7:42 AM
  • Hi Arun,

    I suggest creating a linked server to “WILSAP01\CitectHistorian” and make sure “RPC Out” options is “True”. For more detail information, please refer to the following link:

    Create Linked Servers (SQL Server Database Engine)
    http://msdn.microsoft.com/en-us/library/ff772782.aspx

    Linked Server Properties (Security Page)
    http://msdn.microsoft.com/en-us/library/ms188477.aspx


    Allen Li
    TechNet Community Support

    Friday, May 03, 2013 3:19 AM
    Moderator
  • Hi All,

    Thanks for those replies. the issue was finally resolved after enabling the " Allow Inprocess" under the SQLNCLI10 properties in the Linked servers.

    -Arun Sahani

     

    • Marked as answer by Arun Sahani Monday, May 06, 2013 2:42 AM
    Monday, May 06, 2013 2:42 AM