文章分类 -  处理数据库

摘要:用到了函数GO/****** 对象: UserDefinedFunction [dbo].[GetChild] 脚本日期: 10/07/2014 10:41:02 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE funct... 阅读全文
posted @ 2014-10-07 10:46 牡丹 阅读(232) 评论(0) 推荐(0)
摘要:select * from Users where charindex(','+ltrim(id), (select ','+attendlist from MembersUser where name='mudan' ) )>0 阅读全文
posted @ 2014-06-06 16:13 牡丹 阅读(294) 评论(0) 推荐(0)
摘要:系统自带的存储过程SP_SPACEUSEDEXEC SP_SPACEUSED 'dbo.selltest' 阅读全文
posted @ 2014-04-24 10:41 牡丹 阅读(112) 评论(0) 推荐(0)
摘要:set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgo--TOP n 实现的通用分页存储过程(转自邹建)create PROC [dbo].[sp_PageView]@tbname sysname, --要分页显示的表名@Field... 阅读全文
posted @ 2014-04-22 17:11 牡丹 阅读(114) 评论(0) 推荐(0)
摘要:--判断临时表是否存在if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#TEMP_TBL') and type='U')begintruncate table #TEMP_TBLendELSE... 阅读全文
posted @ 2014-01-26 13:42 牡丹 阅读(95) 评论(0) 推荐(0)
摘要:CREATEPROCEDUREDInstitute_Insert@InstituteNOnvarchar(6),@InstituteNamenvarchar(40)ASdeclare@returnint,@countintif(ltrim(rtrim(@InstituteName))=''orltr... 阅读全文
posted @ 2014-01-20 09:35 牡丹 阅读(292) 评论(0) 推荐(0)
摘要:declare @result nvarchar(80)--用来处理结果的变量begin--声明一个游标 Declare curStudentFee Cursor for SELECT convert(bigint,[学籍号]) FROM OPENROWSET('MICROSOFT.JET.OLE... 阅读全文
posted @ 2014-01-18 10:04 牡丹 阅读(216) 评论(0) 推荐(0)
摘要:错误描述:SQL Server阻止了对组件‘xp_cmdshell’的过程‘sys.xp_cmdshell’的访问。因为此组件已作为此服务嚣安全配置的一部分而被关闭。系统管理员可以通过使用sp_configure启用‘xp_cmdshell’。有关启用‘xp_cmdshell’的详细信息,请参阅sQ... 阅读全文
posted @ 2014-01-17 09:21 牡丹 阅读(3737) 评论(0) 推荐(0)
摘要:select *,Row_Number() OVER (ORDER BY tkid) as row from dbo.tb_tk where parId =9 阅读全文
posted @ 2013-12-03 16:50 牡丹 阅读(69) 评论(0) 推荐(0)
摘要:set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go--分割字符函数 ALTER Function [dbo].[f_Split](@Sql varchar(2000),@Splits varchar(10)) returns @temp Table (temp... 阅读全文
posted @ 2013-12-03 16:49 牡丹 阅读(130) 评论(0) 推荐(0)