摘要: sql语句删除由于无主键导致完全重复的数据方法select distinct * into #Tmp from t_columndrop table t_columnselect * into t_column from #Tmpdrop table #Tmp 阅读全文
posted @ 2013-09-23 17:14 程序员徐坤 阅读(415) 评论(0) 推荐(1) 编辑
摘要: SQL Server数据库中,如果一个表没有主键,我们该如何查询呢?本文我们主要就介绍了如何查询数据库中没有主键的表名并为其增加主键的方法,希望能够对您有所帮助。该功能的实现代码如下: declare @tablename sysname declare @strsql nchar(500) declare tableNameCursor cursor for select b.name from sysobjects b where xtype='U' and b.name not in (sele... 阅读全文
posted @ 2013-09-23 15:08 程序员徐坤 阅读(4130) 评论(0) 推荐(1) 编辑