Log in
::
Register
::
Not logged in
Search:
Home
Articles
Editorials
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Advertise
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 7,2000
»
T-SQL
»
Could not execute query against OLE DB...
Could not execute query against OLE DB provider 'MSDASQL'. [SQLSTATE 42000]...
Rate Topic
Display Mode
Topic Options
Author
Message
Pat Henz
Pat Henz
Posted Tuesday, July 07, 2009 8:00 AM
SSC Rookie
Group: General Forum Members
Last Login: 2 days ago @ 9:50 AM
Points: 45,
Visits: 57
Has anybody came across this error in SQL 2000? I have searched and haven't found much info on the following issue. Anybody have any information on this would be greatly appreciated.
This is in a stored procedure which runs in job that runs every fifteen minutes.
This is the error that I am getting:
Could not execute query against OLE DB provider 'MSDASQL'. [SQLSTATE 42000] (Error 7320) Transaction context in use by another session.] [SQLSTATE 01000] (Error 7312) OLE DB error trace [OLE/DB Provider 'MSDASQL' ICommandText::Execute returned 0x80040e14]. [SQLSTATE 01000] (Error 7300). The step failed.
Here is the description of what is causing this error:
It is in a stored procedure within a Begin Tran on an Insert Statement with a Select statement which has a Case Statement inside the select then in the when another select statement going againt a view.
The piece of code causing the problem:
Begin Tran
insert into #TEMP
select PKG_TCK_NR, '
+ dbo.quotestring(@ID) + ' AS SER_NR,
case when CONVERT(smalldatetime, DT)
IN (Select top 2 srt_dt from dbo.VGetLast3BODRows )
THEN
CONVERT(smalldatetime, LD.OUB_SRT_DT)
Else ' + dbo.quotestring(@SRT_DT) + ' End as S_DT,
TS
======================================================
I found a workaround where I took the select statement out of the case statement and it worked fine. Also when I took the whole insert out of the Begin Tran it worked fine too.
Just asking if any has come across this?
Thanks.
Pat
Post #748552
Pat Henz
Pat Henz
Posted Tuesday, July 14, 2009 9:17 AM
SSC Rookie
Group: General Forum Members
Last Login: 2 days ago @ 9:50 AM
Points: 45,
Visits: 57
Has anybody ever seen the above error I was getting?
Post #752772
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2009 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use