posted @ 2007-12-17 10:41 csdnexpert 阅读(133) 评论(0) 推荐(0)
摘要:
/*--修改自定义数据类型精度的示例 自定义数据类型一旦被引用,就不能再修改和删除,如果要修改数据的精度,就非常麻烦,下面的示例演示了如何修改 假设要修改的自定义变量名为aa--*/--1.修改自定义变量类型的名称exec sp_rename 'aa','aa_bak','USERDATATYPE'go--2.新增自定义变量(按新的精度)EXEC sp_addtype N'aa... 阅读全文
摘要:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[p_qry]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)drop procedure [dbo].[p_qry]GO/*--查询重复记录的通用存储过程 可以查询出表中那些数据是重复的,这里的重复,是指除主键... 阅读全文
posted @ 2007-12-17 10:41 csdnexpert 阅读(87) 评论(0) 推荐(0)
摘要:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[p_qry]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)drop procedure [dbo].[p_qry]GO/*--生成交叉表的简单通用存储过程 根据指定的表名,纵横字段,统计字段,自动生成交叉表 ... 阅读全文
posted @ 2007-12-17 10:41 csdnexpert 阅读(79) 评论(0) 推荐(0)
摘要:
/*--ntext搜索 按 tb 表中的 keyword 在 ta 中查找 content 列出每个 keyword 在 content 中的具体位置--邹建 2004.07(引用请保留此信息)--*/--测试数据create table ta(id int identity(1,1),content ntext)insert ta select '我是中国人我是中国人'union all s... 阅读全文
posted @ 2007-12-17 10:41 csdnexpert 阅读(104) 评论(0) 推荐(0)
摘要:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[p_split]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)drop procedure [dbo].[p_split]GO/*--Ntext字段拆分处理 按指定的分隔符,将 ntext 字段拆分成多条记录 ... 阅读全文
posted @ 2007-12-17 10:41 csdnexpert 阅读(103) 评论(0) 推荐(0)
摘要:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[p_stuff]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)drop procedure [dbo].[p_stuff]GO/*--Ntext字段处理 模拟字符串处理函数 stuff 完成表中 ntext 字... 阅读全文
posted @ 2007-12-17 10:41 csdnexpert 阅读(89) 评论(0) 推荐(0)
摘要:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[p_JobSet]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)drop procedure [dbo].[p_JobSet]GO/*--定时调用存储过程 创建一个在指定时间,调用指定存储过程的作业 作业执行完... 阅读全文
posted @ 2007-12-17 10:41 csdnexpert 阅读(115) 评论(0) 推荐(0)
摘要:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[f_split]') and xtype in (N'FN', N'IF', N'TF'))drop function [dbo].[f_split]GO/*--得到字符串列表指定位置的字符 可以自定义字符串列表的分隔符 如果取数位置超出的范围,返回空字... 阅读全文
posted @ 2007-12-17 10:41 csdnexpert 阅读(94) 评论(0) 推荐(0)
摘要:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[f_updatestr]') and xtype in (N'FN', N'IF', N'TF'))drop function [dbo].[f_updatestr]GO/*--更新字符串列表中,指定位置的字符串 更新字符串列表中,指定位置的字符串为新的值... 阅读全文
posted @ 2007-12-17 10:41 csdnexpert 阅读(89) 评论(0) 推荐(0)
浙公网安备 33010602011771号