随笔分类 -  sql

SQL批量插入数据【万级】
摘要:1、每4000条插入一次 for (int i = 0; i < dt.Rows.Count; i++) { IsTBProductForStockInfo model = new IsTBProductForStockInfo(); model.SyncSkuCode = dt.Rows[i][" 阅读全文

posted @ 2020-07-10 16:34 IT小白鸽 阅读(654) 评论(0) 推荐(0)

sql 增加修改表格属性字段
摘要:1、修改字段默认值 alter table 表名 drop constraint 约束名字 注解:删除表的字段的原有约束 alter table 表名 add constraint 约束名字 DEFAULT 默认值 for 字段名称 注解:添加一个表的字段的约束并指定默认值 2、修改字段名: alt 阅读全文

posted @ 2019-05-23 10:18 IT小白鸽 阅读(3646) 评论(0) 推荐(0)

Sql 查询当天、本周、本月记录、上周、上月记录
摘要:查询当天: select * from info where DateDiff(dd,datetime,getdate())=0 查询24小时内: select * from info where DateDiff(hh,datetime,getDate())<=24 查询当天: select *  阅读全文

posted @ 2019-04-02 10:17 IT小白鸽 阅读(2638) 评论(0) 推荐(0)

导航