- 前提名命空间:using System.Text;
- StringBuilder Builder = newStringBuilder();//字符串拼接
- Builder.AppendLine("Declare @fk_guid int set @fk_guid='" + fk_guid + "'");
- //查申请数
- Builder.AppendLine("select Guid,a1 MaterialGuid,case when a3 is null then a2 else a3 end Amount into #TT from T_WuPinShenQing_01 where
- fk_guid=@fk_guid");
- //清除已前的占料数据
- Builder.AppendLine("Delete T_WuPinShenQing_03 where fk_guid=@fk_guid and Status=2");
- Builder.AppendLine("Drop Table #TT");
- Console.WriteLine(Builder.ToString());
- Builder拼结输出结果:
- Declare @fk_guid int set @fk_guid='" + fk_guid + "'
- select Guid,a1 MaterialGuid,case when a3 is null then a2 else a3 end Amount into #TT from T_WuPinShenQing_01 where fk_guid=@fk_guid
- Delete T_WuPinShenQing_03 where fk_guid=@fk_guid and Status=2
- Drop Table #TT