SQLÓï¾äÖÐ N ºó½ÓÐø×Ö·û´®µÄ×÷ÓÃ
È磺SET @sql=N'SELECT * from stu'
ÆäÖГN”µÄ×÷ÓÃÊDZíʾºóÃæµÄ±àÂë¸ñʽΪunicode±àÂë
DECLARE @rst INT,@sql NVARCHAR(4000)
SET @sql=N'SELECT * from tb '
EXEC sp_executesql @sql,N'@rst INT OUTPUT',@rst OUTPUT
SELECT @rst
Ïà¹ØÎĵµ£º
SQL Server 2008 ¸´ÖÆ ·ÖÇøSWITCHÇåÀíÊý¾Ý
³¡¾°£º
ijÖÖÌض¨ÒµÎñÏ£¬ÎÒÃǵIJ¿·ÖÒµÎñÊý¾Ý¿ÉÄÜÖ»»á±£Áô±È½Ï¶ÌµÄʱ¼ä£¬ÓÃÀ´×öÁÙʱ´¦Àí¡£ÒòΪ¿¼ÂǸ߿ÉÓõÄÌØÐÔ£¬¿ÉÄÜ»áÀûÓÃ
SQL ServerµÄ¸´ÖÆ×é¼þ¸´ÖÆÕâÖÖÊý¾Ýµ½ÁíÍâµÄ ÀàËÆÇ°¶Ë£¬²éѯÖÐÐĵÈÊý¾Ý¿â·þÎñÆ÷£¬´´½¨Ò»¸öÈßÓั±¾¡£¸´ÖÆ×é¼þ±ê¼ÇÊÂÎñÈÕÖ¾£¬×·×ÙËùÓеÄUpdate£¬In ......
declare @t varchar(255),@c varchar(255)
declare table_cursor cursor for select a.name,b.name
from sysobjects a,syscolumns b ,systypes c
where a.id=b.id and a.xtype='u'&n ......
SQlÊý¾ÝÀàÐÍ(-_-ѧSQL¾Í´ÓÊý¾ÝÀàÐÍ¿ªÊ¼°É£¡)
bit ÕûÐÍ
ÆäÖµÖ»ÄÜÊÇ0¡¢1»ò¿ÕÖµ¡£
ÕâÖÖÊý¾ÝÀàÐÍÓÃÓÚ´æ´¢Ö»ÓÐÁ½ÖÖ¿ÉÄÜÖµµÄÊý¾Ý£¬ÈçYes »òNo¡¢True »òFalse ¡¢On »òOff.
int ÕûÐÍ 4¸ö×Ö½Ú
´Ó- 2^31(-2147483648)µ½2^31 (2147483 647)Ö®¼äµÄÕûÊý¡£
´æ´¢µ½Êý¾Ý¿âµÄ¼¸ºõËùÓÐÊýÖµÐ͵ÄÊý¾ ......
Select TOP N * from TABLE Order By NewID()
--Access£º
Select TOP N * from TABLE Order By Rnd(ID)
Rnd(ID) ÆäÖеÄIDÊÇ×Ô¶¯±àºÅ×ֶΣ¬¿ÉÒÔÀûÓÃÆäËûÈκÎÊýÖµÀ´Íê³É£¬±ÈÈçÓÃÐÕÃû×Ö¶Î(UserName)
Selec ......