C#sql 多个字段修改 数据类型,不会拼接的就只能这样写


            SqlConnection conn = new SqlConnection("server=USER-20170808BM\\SQLEXPRESS;uid=sa;pwd=*****;database=lijunyaoye2019;Max Pool Size = 512;");
            conn.Open();


            string sql1 = "alter table 盘点表 alter column 销售数 money";

            string sql2 = "alter table 盘点表 alter column 上月末库存 money";

            string sql3 = "alter table 盘点表 alter column 购进数量 money";

            string sql4 = "alter table 盘点表 alter column 采购数量 money";




            SqlCommand com = new SqlCommand(sql1, conn);

            com.ExecuteNonQuery();



            SqlCommand com2 = new SqlCommand(sql2, conn);

            com2.ExecuteNonQuery();


            SqlCommand com3 = new SqlCommand(sql3, conn);

            com3.ExecuteNonQuery();


            SqlCommand com4 = new SqlCommand(sql4, conn);

            com4.ExecuteNonQuery();



            conn.Close();


winform代码
桂ICP备16004754号