一个proc
里面有语句输出sql便于调试,但是,用print,不能全部显示,
print @sqlstr1
比如显示:
select t.colthno, substring(t.color_nos,1,3) as color,t.colthname,t1.brand,t1.kind,t1._year,t1.season,t1.sex,t1.b_class,t1.serial,
sum(case when t.dbno= '1001 ' then t.XS else 0 end) as [销售1001],sum(case when t.dbno= '1001 ' then t.QRC else 0 end) as [存货1001],
sum(case when t.dbno= '1002 ' then t.XS else 0 end) as [销售1002],sum(case when t.dbno= '1002 ' then t.QRC else 0 end) as [存货1002],
sum(case when t.dbno= '1004 ' then t.XS else 0 end) as [销售1004],sum(case when t.dbno= '1004 ' then t.QRC else 0 end) as [存货1004],
sum(case when t.dbno= '1005 ' then t.XS else 0 end) as [销售1005],sum(case when t.dbno= '1005 ' then t.QRC else 0 end) as [存货1005],
sum(case when t.dbno= '1006 ' then t.XS else 0 end) as [销售1006],sum(case when t.dbno= '1006 ' then t.QRC else 0 end) as [存货1006],
sum(case when t.dbno= '1007 ' then t.XS else 0 end) as [销售1007],sum(case when t.dbno= '1007 ' then t.QRC else 0 end) as [存货1007],
sum(case when t.dbno= '1008 ' then t.XS else 0 end) as [销售1008],sum(case when t.dbno= '1008 ' then t.QRC else 0 en
(1 row affected)
(return status = 0)
------解决方案--------------------------------------------------------
在转换为SQL2000格式,用查询分析器测试,sybase和sql2000的语法差不多的。
或者用rapid sql 来调试