摘要: select Age1 from Student where Name = '张三' create nonclustered index Tw on Student(Name) include(Age1) 创建索引时,可以加上这个 include(Age1) 阅读全文
posted @ 2022-07-23 09:46 艾特-天空之海 阅读(10) 评论(0) 推荐(0) 编辑
摘要: option (recompile)使用在语句 select * from Student where id =1 option (recompile) 使用在存储过程 create proc proc_test (@i int) with recompile as select * from St 阅读全文
posted @ 2022-07-23 08:56 艾特-天空之海 阅读(20) 评论(0) 推荐(0) 编辑
摘要: exec 是解决存储过程parameter sniffer 的方式之一; 用法例子: Declare @sql varchar(1000); set @sql = 'select * from Student'; exec (@sql); 阅读全文
posted @ 2022-07-23 08:26 艾特-天空之海 阅读(100) 评论(0) 推荐(0) 编辑