Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 execute sql task

Author  Topic 

saiabhiram
Starting Member

17 Posts

Posted - 2010-04-24 : 16:33:50
Hello I am using this query in execute sql task:

and where I have a question mark I want to pass a variable which is user defined. How do I accomplish this?? I am getting an error

[Execute SQL Task] Error: Executing the query "
USE [EDMSTAGE]

INSERT INTO [STG_RA6100MU_TRA_EXC..." failed with the following error: "Syntax error, permission violation, or other nonspecific error". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.


Below is the query:

USE [EDMSTAGE]

INSERT INTO [STG_RA6100MU_TRA_EXCP_HDR]
SELECT ?,T.* FROM dbo.TRA_EXCP_HDR T
INNER JOIN STG_RA6100MU_CBA_TRAN_TABLE A ON A.PCT_BILLING_ROAD = T.BILL_RD
where (OWNR_MRK_CD = 'GONX' OR OWNR_MRK_CD ='TTX') AND (EXCP_TYP_CD = 'O' AND (EXCP_LTR_STAT = 'L' OR EXCP_LTR_STAT = 'M'))
UNION
SELECT ?, T.* FROM TRA_EXCP_HDR T INNER JOIN STG_RA6100MU_OCR_CLIENT_CODE O ON O.OCR_CLIENT_INIT = T.OWNR_MRK_CD
INNER JOIN STG_RA6100MU_CBA_TRAN_TABLE A ON A.PCT_BILLING_ROAD = T.BILL_RD
WHERE OCR_CLIENT_PAYABLE_AP ='Y' AND (EXCP_TYP_CD = 'O' AND(EXCP_LTR_STAT = 'L' OR EXCP_LTR_STAT = 'M' ))


visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-25 : 02:08:03
what have you set for resultset property?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -