易截截图软件、单文件、免安装、纯绿色、仅160KB

SQL常用函数之三 REPLICATE () ?


按指定次数重复字符表达式。
语法
REPLICATE ( character_expression, integer_expression)
参数
character_expression
字符数据型的字母数字表达式,或者可以隐式转换为 nvarchar 或 ntext 的其他数据类型的字母数字表达式。
integer_expression
可以隐式转换为 int 的表达式。如果 integer_expression 为负,将返回空字符串。
返回值
nvarchar 或 ntext
1 :Select Replicate('abc',2) ----------------abcabc
2 :Select Replicate('abc',-2) ----------------null
3 :Select Replicate('abc',0)--------------- 无


相关文档:

如何彻底删除SQL Server2005

1.Stop 所有服务
 
2.用 Windows Install Clean Up 工具卸载SQL 2005组件
 
3.用SrvInstw.exe删除所有SQL服务
 
4.清除注册表
   a. 将HKEY_CURRENT_USER---Software----Microsoft下的Microsoft SQL Server文件夹全部删除
   b. 将HKEY_LOCAL_mACHINE---SOFTWARE---Microsoft下 ......

Sql(事物+游标)使用方法

--当两个或两以上的操作要么都执行,要么都不执行时要用事务。
1. Sql写法(事物+游标)
--开始事务
BEGIN TRAN
--不显示计数信息
SET NOCOUNT ON
DECLARE @ProjNo varchar(50),@CusNo varchar(50)
--声明游标
DECLARE CRMPSContact_cursor CURSOR FOR 
SEL ......

sql 区间时间判断

[code]declare @startdt datetime
declare @enddt datetime
select @startdt='2009-12-03',@enddt='2009-12-05'
select * from tb
where 开始日期 between @startdt and @enddt
or 结束日期 between @startdt and @enddt
or @startdt between 开始日期 and 结束日期
or @enddt between 开始日期 and ......

sql查询的无限分类查询的设计

最近在找一次sql查询的无限分类查询的设计,网上找了一下这个数据表的设计很有特色,
不用递归,依靠个简单SQL语句就能列出菜单,看看这个数据表怎么设计的,并对下面的数据表结构的查询进行分析.
数据库字段大概如下:
-----------------------------------------------------------------------------------
id  ......

SQL-查询所有触发器

----查看所有角本
Create table #y (txt text)
select name, iid = identity(int,1,1) into #x from SysObjects where xtype = 'TR'
declare @i int, @max int
declare @name varchar(40)
set @i = 1
select @max = max(iid) from #x
while @i <= @max
begin
    select @name = name from #x w ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号