摘要:
select 'ALTER TABLE '+o.name+' NOCHECK CONSTRAINT '+fk.name+';' AS Commandfrom sys.foreign_keys fk JOIN sys.all_objects o ON (fk.parent_object_id=o.object_id) 复制结果, 粘贴出来执行. 就停用 外键约束了.然后你去删除数据去.数据删除好了, 再启用外键约束select 'ALTER TABLE ' + o.name + ' CHECK CONSTRAINT ' 阅读全文
摘要:
--查询所有索引SELECTtab.name AS [表名],idx.name AS [索引名称],col.name AS [列名]FROMsys.indexes idxJOIN sys.index_columns idxColON (idx.object_id = idxCol.object_idAND idx.index_id = idxCol.index_id)JOIN sys.tables tabON (idx.object_id = tab.object_id)JOIN sys.columns colON (idx.object_id = col.object_idAND idxCo 阅读全文
摘要:
--插入数据insert into student(id,sname,j2se,j2ee,jsp)values(1,'张三',80,60,70);--更新数据update student set sname= '张三' where id=1;--增加字段ALTER TABLE table_NAME ADDcolumn_NAMEvarchar(30)--删除字段ALTER TABLE table_NAME DROP COLUMNcolumn_NAME--修改字段类型ALTER TABLE table_NAMEALTER COLUMN column_NAMEnew_ 阅读全文
摘要:
运行—regedit—进入注册表: [HKEY_CURRENT_USER/Software/Microsoft/Terminal Server /Client/Default] 阅读全文