简单的3个SQL视图搞定所有SqlServer数据库字典 转
数据库字典包括表结构(分2K和2005)、索引和主键.外键.约束.视图.函数.存储过程.触发器.规则。可以在企业管理器、查询分析器中简单执行,直接了当的查出SQL2K及SQL2005的所有数据字典,方便文档的编写,希望对大家有帮助。
1. SqlServer2000数据库字典--表结构.sql
SELECT TOP 100 PERCENT --a.id,
CASE WHEN a.colorder = 1 THEN d.name ELSE '' END AS 表名,
CASE WHEN a.colorder = 1 THEN isnull(f.value, '') ELSE '' END AS 表说明,
a.colorder AS 字段序号, a.name AS 字段名, CASE WHEN COLUMNPROPERTY(a.id,
a.name, 'IsIdentity') = 1 THEN '√' ELSE '' END AS 标识,
CASE WHEN EXISTS
(SELECT 1
from dbo.sysindexes si INNER JOIN
dbo.sysindexkeys sik ON si.id = sik.id AND si.indid = sik.indid INNER JOIN
dbo.syscolumns sc ON sc.id = sik.id AND sc.colid = sik.colid INNER JOIN
dbo.sysobjects so ON so.name = si.name AND so.xtype = 'PK'
WHERE sc.id = a.id AND sc.colid = a.colid) THEN '√' ELSE '' END AS 主键,
b.name AS 类型, a.length AS 长度, COLUMNPROPERTY(a.id, a.name, 'PRECISION')
AS 精度, ISNULL(COLUMNPROPERTY(a.id, a.name, 'Scale'), 0) AS 小数位数,
CASE WHEN a.isnullable = 1 THEN '√' ELSE '' END AS 允许空, ISNULL(e.text, '')
AS 默认值, ISNULL(g.[value], '') AS 字段说明, d.crdate AS 创建时间,
CASE WHEN a.colorder = 1 THEN d.refdate ELSE NULL END AS 更改时间
相关文档:
VS2008 添加SQLServer文件 经常会碰到错误,现在将几个常见的错误罗列一下,
“此版本的 sql server 不支持用户实例登录标志。该连接将关闭。”
解决办法:
在连接属性的设置里边,点“高级”,将User Instance 设置为false,默认的true,所以才导致这个问题的出现.
“与SQL Server文件(*.m ......
http://zhanglei1286.blog.163.com/blog/static/1895797120091112113019600/
在后台代码里:
SQL 2000:
static string StrConn = "server=.;uid=sa;pwd=sa;database=MyCUDS";
SQL2005:
con = new SqlConnection(@"Server=.\SQLExpress;Database=db_CMS;Persist Security Info=True;User ID=sa;Password=Masslong");
......
下面所有的SQL语句都是针对前缀为wp_的表,如果你的表前缀不是wp_,请做相应的修改
1.更改wordpress安装和首页地址
如果你更换域名或者把wordpress的安装目录进行了变动就需要进行修改,
UPDATE wp_options SET option_value = replace(option_value, ‘旧网址’, ‘新网址’) WHERE option_name ......
On BULK COLLECT
By Steven Feuerstein Oracle ACE
Best practices for knowing your LIMIT and kicking %NOTFOUND
I have started using BULK COLLECT whenever I need to fetch large volumes of data. This has caused me some trouble with my DBA, however. He is complaining that although my programs mig ......
linq to sql 在插入值的时候还是很方便。有时候我们需要在插入一个新的实体之后得到那个实体的主键ID的值,这个ID当然必须是自增。一段时间我一直认为直接使用linq to sql的插入机制是不可以在做到的,所以只有使用存储过程的,具体可以查看这篇文章:http://blog.benhall.me.uk/2008/01/custom-insert-logic-with-linq-to- ......