随笔分类 - SqlServer
摘要:USE [DoctorInfo]GO/****** Object: UserDefinedFunction [dbo].[DoctorMultiQuery] Script Date: 12/12/2015 20:36:41 ******/SET ANSI_NULLS ONGOSET QUOTED_I...
阅读全文
摘要:sql 列转化行的方法SELECT ClassId FROM Class WHERE OgId=586 and Grade=2011 select parentId=(select ParentId from Organization where Id=586), ClassId=isnull((s...
阅读全文
摘要:Create function [dbo].[GetChildWorkerExtension]( @ChildId int)returns nvarchar(100)asbegin declare @ret nvarchar(2000) set @ret = '' select @ret ...
阅读全文
摘要:--在执行该脚本程序之前启动sql server的全文搜索服务,即microsoft search服务 use huarui_db --打开数据库 go --检查huarui_db是否支持全文索引,如果不支持全文索引,则使用sp_fulltext_datebase打开该功能 if (select databaseproperty ('huarui_db','IsFulltextEnables'))=0 execute sp_fulltext_database 'enable' --建立全文目录FullText_huarui_db execute
阅读全文
摘要:WITH RBoardDiscuss_Table(OpenBoardDiscussID,AssociateItemDefinitionID,AssociateItemID) AS(SELECT OpenBoardDiscussID,AssociateItemDefinitionID,Associat...
阅读全文
摘要:1.往一个表中添加新的一列并添加默认值alter table ClassToCourse add StuYear int not null default 0 with values;2. 查询分组后的多余的一条数据select * from ChargeStardSet where id in (select max(id) from ChargeStardSet group by ChargeItemId,StuAttendSchool,OgId having count(*) > 1)
阅读全文