随笔分类 -  SQL Server

摘要:获得所有数据库表名: 阅读全文
posted @ 2016-10-04 08:38 sonicit 阅读(5020) 评论(0) 推荐(0)
摘要:SELECT ColumnsName = c.name, [Description] = ex.value, ColumnType = t.name, [Length]=c.max_lengthFROM sys.columns c LEFT OUTER JOIN sys.extended_prope... 阅读全文
posted @ 2015-09-04 17:12 sonicit 阅读(534) 评论(0) 推荐(0)
摘要:DBCC CHECKIDENT (‘TABLE_NAME’,RESEED,0) 阅读全文
posted @ 2009-08-16 09:24 sonicit 阅读(508) 评论(0) 推荐(0)
摘要:错误信息: 服务器: 消息 15135,级别 16,状态 1,过程 sp_validatepropertyinputs,行 100. 对象无效。 不允许在 '.cash_flux' 上使用扩展属性,或对象不存在。 在使用PowerDesigner12设计数据库时,没有为表指定Owner,于是出现了上述错误,因为我需要为表和字段生成注释,如下: ex... 阅读全文
posted @ 2008-04-22 14:51 sonicit 阅读(1260) 评论(0) 推荐(0)
摘要:建表语句中,在要做为自增列的字段中,加上如下 IDENTITY(1,1) 重置自增种子 dbcc checkident(ConfigSys,reseed,0); 阅读全文
posted @ 2008-04-18 16:16 sonicit 阅读(435) 评论(0) 推荐(0)
摘要:1declare @Menu_id varchar(250) 2declare @pos int 3declare @oldPos int 4declare @tempstr varchar(100) 5 6 7create table #temp_id ( id int ) 8 9set @Menu_id = '60,62,63,64' 10set @pos=1 11... 阅读全文
posted @ 2008-01-19 21:06 sonicit 阅读(578) 评论(0) 推荐(0)
摘要:The specified '@subsystem' is invalid (valid values are returned by sp_enum_sqlagent_subsystems). (.Net SqlClient Data Provider)Error Number: 14234Severity: 16State: 1Procedure: sp_verify_subsystemLin... 阅读全文
posted @ 2007-07-09 20:15 sonicit 阅读(1027) 评论(2) 推荐(0)
摘要:--MyDB为修复的数据名USE MASTER GO SP_CONFIGURE 'ALLOW UPDATES',1 RECONFIGURE WITH OVERRIDE GO ALTER DATABASE MyDB SET EMERGENCY GO sp_dboption 'MyDB', 'single user', 'true' GO DBCC CHECKDB('MyDB','REPAIR_ALL... 阅读全文
posted @ 2007-07-09 20:15 sonicit 阅读(23152) 评论(23) 推荐(2)
摘要:DECLARE @sp_name nvarchar(400)DECLARE @sp_content nvarchar(2000)DECLARE @asbegin intdeclare @now datetimeselect @now = getdate()DECLARE sp_cursor CURSOR FOR SELECT object_name(id)FROM sysobjectsWHERE ... 阅读全文
posted @ 2007-07-09 20:13 sonicit 阅读(379) 评论(0) 推荐(0)