摘要:
1.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索引而进行全表扫描。 2.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 3.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引 阅读全文
摘要:
同时带Return和output参数的存储过程 if exists(select name from sysobjects where name=’up_user’ and type=’p’) drop proc up_user go create proc up_user @id int, @na 阅读全文
摘要:
1、判断数据表是否存在 方法一: use yourdb; go if object_id(N'tablename',N'U') is not null print '存在' else print '不存在' 例如: use fireweb; go if object_id(N'TEMP_TBL',N 阅读全文
摘要:
'UTF-8编码 Public Function UTF8Encode(ByVal szInput As String) As String Dim wch As String Dim uch As String Dim szRet As String Dim x As Long Dim input 阅读全文
摘要:
SELECT (case when a.colorder=1 then d.name else null end) 表名, a.colorder 字段序号,a.name 字段名, (case when COLUMNPROPERTY( a.id,a.name,'IsIdentity')=1 then 阅读全文