数据库
wangfeng8317
这个作者很懒,什么都没留下…
展开
-
获取表中字段信息(主外键,字段名,数据类型,字段长度,列说明)
select(case when PKeyCol.COLUMN_NAME is null then else PK end) +(case when KeyCol2.COLUMN_NAME is null then when NOT PKeyCol.COLUMN_NAME is null then ,FK else FK end) as [主/外键],col.C原创 2008-02-03 11:25:00 · 8827 阅读 · 2 评论 -
SQL Server 知识点!
1.按姓氏笔画排序:Select * From TableName Order By CustomerName Collate Chinese_PRC_Stroke_ci_as 2.数据库加密:select encrypt(原始密码)select pwdencrypt(原始密码)select pwdcompare(原始密码,加密后密码) = 1--相同;否则不相同 encryp转载 2008-01-10 14:54:00 · 522 阅读 · 0 评论 -
带条件的添加语句(insert +where 条件)
if((select count(*) from wf where id=2)=0)insert into wf values(2,sdf,sdgghh,fgfg,gfghj)原创 2008-01-09 16:47:00 · 9583 阅读 · 0 评论 -
sql语句查询表的字段名
select name from syscolumns where id in (select id from sysobjects where type = u and name = 相应表名) 用以上sql语句输入相应表名就可以查到表的字段名,对应好数据库 查询是否存在该表语句 select name from syscolumns where id=object_id(原创 2008-01-10 13:35:00 · 638 阅读 · 0 评论