摘要:1)SELECT 子句中避免使用 “*” 当你想在 SELECT 子句中列出所有的 columns 时,使用动态 SQL 列引用‘*’是一个方便的方法。不幸的是,这是一个非常低效的方法。 实际上,Oracle 在解析的过程中, 会将“*” 依次转换成所有的列名, 这个工作是通过查询数据字典完成的,
阅读全文
摘要:CREATE UNIQUE NONCLUSTERED INDEX un_CompanyInfo_FK_CompanyId ON dbo.CompanyInfo(FK_CompanyId) WHERE FK_CompanyId is not null GO
阅读全文
摘要:--公司注册 if exists(select * from Sysobjects where name='usp_CompanyRegister') drop procedure usp_CompanyRegister; go create procedure usp_CompanyRegiste
阅读全文
摘要:SELECT * FROM dbo.CheJianSegmentation WHERE CONVERT(VARCHAR(7),AddTime,120)=CONVERT(VARCHAR(7),@AddTime,120)
阅读全文
摘要:use MustGoHome; --判断该事物是否存在,存在就删除 if exists(select * from Sysobjects where name='usp_UserLogin') drop procedure usp_UserLogin; GO--/创建登录事物 create proc
阅读全文
摘要:if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sys_Page_v2]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].
阅读全文
摘要:use MustGoHome; --公司注册 if exists(select * from Sysobjects where name='usp_CompanyRegister') drop procedure usp_CompanyRegister; go create procedure us
阅读全文
摘要:declare c cursor for select NAME from sysobjects where xtype='U' declare @t varchar(200) open c fetch next from c into @t while @@FETCH_STATUS=0 begin
阅读全文
摘要:USE 库名 GO sp_msforeachtable'drop table?' GO
阅读全文