易截截图软件、单文件、免安装、纯绿色、仅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语句总结二

sql精妙用法
文章分类:数据库
说明:复制表(只复制结构,源表名:a 新表名:b)
select * into b from a where 1<>1
说明:拷贝表(拷贝数据,源表名:a 目标表名:b)
insert into b(a, b, c) select d,e,f from b;
说明:显示文章、提交人和最后回复时间
select a.title,a.username,b.adddate ......

asp.net(c#) 下SQL存储过程使用详细实例

记取记录集
create procedure getArticle
as
select * from Article_Content
GO
asp.net 调用方法
  SqlConnection Conn = new SqlConnection();
        Conn.ConnectionString = Data.Connstr();
        Conn.Open();
  ......

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

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

SQL删除有默认值字段(转)

declare   @dfname   varchar(50)  
select   @dfname=a.name  
from   sysobjects   a
inner join   syscomments   b   on   a.id=b.id  
inner join   sysconstraints  ......

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号