Link to home
Start Free TrialLog in
Avatar of 9772885
9772885

asked on

sybase nolock

I am reading data from a sybase server and im causing a few issues. I want to know if there is a way to pull the data without locking the table? like to nolock command in sql server.
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

Sybase and SQL Server almost have same set of commands till SQL Server 2000 and Sybase versions till that.

Anyhow FYI, Nolock is discontinued from SQL Server 2005 onwards.
Avatar of 9772885
9772885

ASKER

Im pulling my data from sybase into SQL Server 2000 using a linked server. My code looks like this

select * from openquery(LinkServer,'select * from sybasetable WITH( NOLOCK )')


however i am getting an error

[OLE/DB provider returned message: [Native Error code: 156]
[DataDirect ADO Sybase Provider] Incorrect syntax near the keyword 'WITH'.
]
OLE DB error trace [OLE/DB Provider 'Sybase.ASEOLEDBProvider' IColumnsInfo::GetColumnsInfo returned 0x80004005:   ].
Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'Sybase.ASEOLEDBProvider' reported an error.  
Try using without WITH (NOLOCK) keywords and tell me the results.

Kindly check whether the login used for Linked Server Creation has select rights on that table.
How about we start with the Sybase product (there are at least 4) and the complete version (e.g. ASE 12.5.3).

My guess is that you are using ASE, not ASA which is why the ASA-only "NOLOCK" qualifier is not working.

Regards,
Bill
Avatar of 9772885

ASKER

The database is ASE is a nolock commend possible?
No.  NOLOCK is not supported by ASE.

What version of ASE?
Do a "SELECT @@version" and post the results.

Regards,
Bill
Avatar of 9772885

ASKER

i tried that but got this error. Im not sure if its because i only have acces via a linked server?


OLE DB error trace [OLE/DB Provider 'Sybase.ASEOLEDBProvider' IColumnsInfo::GetColumnsInfo returned 0x80004005:  The provider did not give any information about the error.].
Msg 7399, Level 16, State 1, Line 3
OLE DB provider 'Sybase.ASEOLEDBProvider' reported an error. The provider did not give any information about the error.
Hmmm.  If you can't get something simple like SELECT @@version" to work, I am guessing there is something wrong with your linked server / OLE DB setup.

You will have to go straight to the server to get the version information.

What kind(s) of thing(s) are you doing that are causing locks on the table(s)?

Also, what is the overall project requirement?  It may be possible to do something that doesn't have all the limitations and issues associated with a linked server.

Regards,
Bill
Avatar of 9772885

ASKER

version 15

i have a page on noholdlock but im not sure how the syntax would go in my query

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc20021_1251/html/locking/locking88.htm
Avatar of 9772885

ASKER

dotn worry ive sorted it. noholdlock at the ed of the table name.

resolved. thank you for your input people
ASKER CERTIFIED SOLUTION
Avatar of ee_auto
ee_auto

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial