November 2, 2005 at 7:20 am
wHILE IAM RUNNING BELOW QUERI WHICH IS TRACED BY PROFILER IT IS GIVING ERROR
SOME BODY HELP HOW TO SOLVE PROBLEM
declare @P1 int
set @P1=180150000
declare @P2 int
set @P2=8
declare @P3 int
set @P3=1
declare @P4 int
set @P4=8
exec sp_cursoropen @P1 output, N'SELECT WORKORDER.*, DETAIL.*, LOCATION.*, CUSTOMER.*, location.zip as cust_zip, FIRSTNAME,LASTNAME, BusinessUnitDesc,OrgDesc,OrgName FROM WorkOrder, Detail, Location, Customer, mfuser, BUSINESSUNIT BU where WorkOrder.FSRUSERUID = mfuser.Useruid and WORKORDER.FSRBUID = BU.BUID AND WorkOrder.WorkOrderUID = Detail.WorkOrderUID and WorkOrder.WorkOrderUID = Location.WorkOrderUID and WorkOrder.WorkOrderUID = Customer.WorkOrderUID and WorkOrder.FSRUSERUID IS NOT NULL and WORKORDER.FSRBUID IN (''BANG'') AND SCHEDULEDATE = ''2005-11-02'' AND WorkOrder.JobStatus in (''CP'',''JC'',''XO'',''ND'') order by WorkOrder.FSRBUID, WorkOrder.fsrLOGINID, Customer.accountID, WorkOrder.ScheduleDate, WorkOrder.JobTypeDesc ', @P2 output, @P3 output, @P4 output
select @P1, @P2, @P3, @P4
exec sp_cursorfetch 180150000, 16, 1, 1
declare @P1 int
set @P1=1
declare @P2 int
set @P2=8
exec sp_cursorfetch 180150000, 256, @P1 output, @P2 output
select @P1, @P2
November 2, 2005 at 11:03 am
The sp_cursoropen and sp_cursorfetch are stored procedures are used by the Microsoft OLE DB Provider for SQL Server, the SQL Server ODBC driver, and the DB-Library dynamic-link library (DLL) to implement the functionality of a database API.
Executing them explicitly is not supported.
For diagnosing the error, cut and paste the actual SQL statement into Query Analyzer, replace all two quotes with a single quote ( ''x'' should be changed to 'x') and then execute the SQL. What is the error message ?
SELECT WORKORDER.*, DETAIL.*, LOCATION.*, CUSTOMER.*, location.zip as cust_zip, FIRSTNAME,LASTNAME, BusinessUnitDesc,OrgDesc,OrgName FROM WorkOrder, Detail, Location, Customer, mfuser, BUSINESSUNIT BU where WorkOrder.FSRUSERUID = mfuser.Useruid and WORKORDER.FSRBUID = BU.BUID AND WorkOrder.WorkOrderUID = Detail.WorkOrderUID and WorkOrder.WorkOrderUID = Location.WorkOrderUID and WorkOrder.WorkOrderUID = Customer.WorkOrderUID and WorkOrder.FSRUSERUID IS NOT NULL and WORKORDER.FSRBUID IN (''BANG'') AND SCHEDULEDATE = ''2005-11-02'' AND WorkOrder.JobStatus in (''CP'',''JC'',''XO'',''ND'') order by WorkOrder.FSRBUID, WorkOrder.fsrLOGINID, Customer.accountID, WorkOrder.ScheduleDate, WorkOrder.JobTypeDesc
SQL = Scarcely Qualifies as a Language
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply