Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Stored Procedure
Message
 
 
À
26/07/2010 17:57:44
Andy Roth
Neyenesch Printers
Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01473624
Message ID:
01474026
Vues:
28
>>>exec sp_executesql N' SELECT arjobhd.custno, arjobhd.customer, ISNULL(ssslsman.salespn,'''') as salespn, arjobhd.transtype, arjobtax.taxcode, IsNull(arjobhd.invno,0) as invno, arjob.ljob, bbjthead.id, ISNULL(SUM(arjob.price),0) as invoice, ISNULL(SUM(arjob.frtamt),0) as freight, CAST(00.00 AS decimal(10,2)) as tax, CAST(00.00 AS decimal(10,2)) as cost_lab, CAST(00.00 AS decimal(10,2)) as cost_mat, CAST(00.00 AS decimal(10,2)) as cost_fin, CAST(00.00 AS decimal(10,2)) as cost_pur, CAST(00.00 AS decimal(10,2)) as Totcost, CAST(00.00 AS decimal(10,2)) as TotInv, CAST(00.00 AS decimal(10,2)) as profper FROM arjobhd JOIN arjob on arjobhd.invno=arjob.invno JOIN arjobtax on arjobhd.invno=arjobtax.invno JOIN bbjthead on bbjthead.ljob=arjob.ljob JOIN ssslsman on arjobhd.salespnno=ssslsman.salespnno WHERE ( bbjthead.closedate between @P1 and @P2 AND arjobhd.invdate IS NOT NULL AND bbjthead.closedate >= arjobhd.invdate ) OR ( arjobhd.invdate between @P3 and @P4 AND bbjthead.closedate IS NOT NULL AND invdate >= bbjthead.closedate ) Group by arjobhd.custno, arjobhd.customer, ssslsman.salespn, arjobhd.transtype, arjobtax.taxcode, arjobhd.invno, arjob.ljob, bbjthead.id ORDER by arjob.ljob, arjobhd.invno ',N'@P1 datetime,@P2 datetime,@P3 datetime,@P4 datetime','2010-06-01 00:00:00:000','2010-06-30 00:00:00:000','2010-06-01 00:00:00:000','2010-06-30 00:00:00:000'
>>
>>Seems Ok to me. Try now to copy it and run in SSMS.
>
>Results
>Msg 0, Level 11, State 0, Line 0
>A severe error occurred on the current command. The results, if any, should be discarded.
>Msg 0, Level 20, State 0, Line 0
>A severe error occurred on the current command. The results, if any, should be discarded.

I forgot, did you tell me if you use SP3?

I saw recently a thread on MSDN forum with the exact same message. I think it may be a bug in SQL Server 2005 which you hit. If you can not re-write the query, then I suggest to open a case with MS on this. You can also post this issue at MSDN forum. I suggest to post here
http://social.msdn.microsoft.com/Forums/en-US/transactsql/threads
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform