日期:2014-05-18 浏览次数:21444 次
我点击一个按钮,执行如下代码,为什么能点击多次,可以多次select into 临时表 吗? 在查询分析器里只能执行一次select into 临时表。为什么在这里能执行多次? SqlCommand cmd3 = new SqlCommand("select Field_Value from I_defaultvalue where Table_Name='SYSTEM' and Table_Field='CUT_CUSTOM_ORDER_RECORD'", con); string Field_Value=cmd3.ExecuteScalar().ToString(); if (Field_Value=="0") { SqlCommand cmd4 = new SqlCommand("select WRPROD,WRTOOL into tbb from I_CustomOrder group by WRPROD,WRTOOL", con); cmd3.ExecuteReader(); } else { SqlCommand cmd5 = new SqlCommand("select top Field_Value WRPROD,WRTOOL into tbb from I_CustomOrder group by WRPROD,WRTOOL", con); cmd3.ExecuteReader(); }