SQL²éѯÊý¾Ý¿âÖÐÿÕűíµÄ¼Ç¼Êý
±¾ÎÄÀ´×Ô£ºhttp://hi.baidu.com/darkroot/blog/item/7b74be2cf06d76e78b139903.html
declare @tbName nvarchar(500)
declare @ct int
declare @csql nvarchar(500)
declare #tb cursor for SELECT OBJECT_NAME (id) As TableName from sysobjects WHERE xtype = 'U' AND OBJECTPROPERTY (id, 'IsMSShipped') = 0
open #tb
fetch next from #tb into @tbName
while @@fetch_status=0
begin
set @csql = N'Select @ct= Count(*) from ' + @tbName
Exec dbo.sp_executesql @csql,N'@ct int output',@ct output
Print @tbName + '---' + Cast(@ct As nvarchar(500))
fetch next from #tb into @tbName
end
close #tb
deallocate #tb
Ïà¹ØÎĵµ£º
н¨±í£º
create table [±íÃû]
(
[×Ô¶¯±àºÅ×Ö¶Î] int IDENTITY (1,1) PRIMARY KEY ,
[×Ö¶Î1] nVarChar(50) default 'ĬÈÏÖµ' null ,
[×Ö¶Î2] ntext null ,
[×Ö¶Î3] datetime,
[×Ö¶Î4] money null ,
[×Ö¶Î5] int default 0,
[×Ö¶Î6] Decimal (12,4) default 0,
[×Ö¶Î7] image null ,
)
ɾ³ý±í£º
Drop table [±í ......
½ñÌìÏÂÁ˸öWIN7µÄÓ¢Îİü°Ñϵͳ»»³ÉÓ¢Îĵġ£¸Ð¾õ»¹ÐУ¬¿ÉÊǵ±´´½¨Êý¾Ý¿â±íʱ·¢ÏÖ³ö´íÁË£¬²éÁËϲÅÖªµÀÊÇSQLµÄÅÅÐò³öÎÊÌâÁË
ÏÂÃæÊÇCTRL+c V¸ã¹ýÀ´µÄ£¬Ö»ÊÇ·½±ã´ó¼ÒÓÐÕâÑùµÄÎÊÌâ¿ÉÒԵõ½½â¾ö
ʹÓÃSQL2005½øÐд´½¨Êý¾Ý¿âµÄʱºò£¬Èç¹ûÓöµ½´´½¨Ê§°ÜµÄÇé¿ö£¬ÈçÏ£º
Create ¶ÔÓÚ Êý¾Ý¿â“xxxx”ʧ°Ü¡£ (Microsoft.SqlS ......
SQLServerºÍOracleµÄ³£Óú¯Êý¶Ô±È
¡¡¡¡1.¾ø¶ÔÖµ
¡¡¡¡S:select abs(-1) value
¡¡¡¡O:select abs(-1) value from dual
¡¡¡¡2.È¡Õû(´ó)
¡¡¡¡S:select ceiling(-1.001) value
¡¡¡¡O:select ceil(-1.001) value from dual
¡¡¡¡3.È¡Õû£¨Ð¡£©
¡¡¡¡S:select floor(-1.001) value
¡¡¡¡O:select floor(-1.001) value fr ......
1¡¢ ´ò¿ªpl/sql ÖÐtools-preferences£¬ÉèÖÃConnectionÖеÄOracle HomeΪoracle9£¬OCI libraryΪoracle9 Èçͼ
2¡¢
½«oralce10Ŀ¼ÏµÄtnsnames.oraÎļþÀïÃæµÄËùÒªµ¼³öµÄoralce10µÄ·þÎñÅäÖà ¸´ÖƵ½oracle9Ŀ¼ÏµÄtnsnames.oraÎļþÀïÃæ
ORCL =
(DESCRIP ......
ÔÚSQL Server 2008ÖÐÒýÈëÁËhierarchyidÀ´´¦ÀíÊ÷×´½á¹¹¡£ÏÂÃæ¼òµ¥¾ÍÒÔAdventureWorks(ÎÞhierarchyid)ºÍAdventureWorks2008(ÓÐhierarchyid)ÀïµÄHumanResources.EmployeeΪÀý£¬À´ËµÃ÷Ò»ÏÂÔÚеÄhierarchyidÖÐÈçºÎ½øÐÐflat»¯µÄdimension³éÈ¡¡£
AdventureWorksÊÇ΢ÈíΪSQL ServerÌṩµÄÊý¾Ý¿âÐéÄâ°¸Àý¡£
AdventureWorksÖÐËùÒªµ ......