Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2009
    Posts
    47

    Question Unanswered: Cannot specify an index or locking hint for a remote data source

    Hi see if u could help me with the following

    I am accessing a table which is on another DB.
    But when I write Select LinkNo from ServerName.DBName.dbo.LinkMaster with(XLOck) where Linkid=25

    It gives me the following error
    Cannot specify an index or locking hint for a remote data source
    May be the error is due to I m trying to lock a row which is on another server...Could someone suggest me any solution?

  2. #2
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    create a view on the local side

    as select * from tablename with (nolock)

    and reference that view in your remote query.

    or use OpenQuery function.

  3. #3
    Join Date
    Mar 2009
    Posts
    47
    Hi thnks for the reply but the tablename is passed as a paramter can I pass it in a view and access it?

  4. #4
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    just do:
    SELECT LINKNO FROM OpenQuery(LinkServerName,
    'Select LinkNo from DBName.dbo.LinkMaster with (NolOck) where Linkid=25')

Posting Permissions

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