»ñÈ¡SQLServerµÄ×îÍêÕûÊý¾Ý×ÖµäµÄSQLÓï¾ä
Ô´´ÓÚ2008Äê06ÔÂ18ÈÕ£¬2009Äê10ÔÂ18ÈÕǨÒÆÖÁ´Ë¡£
»ñÈ¡SQLServer
µÄ×îÍêÕûÊý¾Ý×ÖµäµÄSQL
Óï¾ä
ÆäʵÍøÉÏÒѾÁ÷´«Á˺ܶà¹ØÓÚ»ñÈ¡
SQLServer
µÄÊý¾Ý×ÖµäµÄ°æ±¾£¬²»¹ýÎÒÏàÐÅÕâ¸öÓ¦¸ÃÊÇ×îÈ«µÄÁË£¬±¾Óï¾ä°üÀ¨ÁË±í¡¢×ֶΡ¢×Ö¶ÎÀàÐÍ¡¢×ֶγ¤¶È¡¢ÊÇ·ñΪ¿Õ¡¢ÊÇ·ñµÝÔö×ֶΡ¢Ë÷ÒýÃû³Æ¡¢Ë÷ÒýµÄ¶¨Î»¡¢Ë÷ÒýÀàÐÍ¡¢Ö÷¼ü¡¢Íâ¼üµÈ£»Í¨¹ýºÏÀíµÄ²Ã¼ô¿ÉÒԺܷ½±ãµÄÉú³ÉÏàÓ¦µÄÊý¾Ý×ֵ䡣
SELECT
sysobjects.name AS
±íÃû³Æ
,ITPUB¸öÈË¿Õ¼äqpd6Bv c~~\0s%?7k(@
--sysproperties.[value] AS
±í˵Ã÷
,
Zqm6iAu:{6517
syscolumns.name AS
×Ö¶ÎÃû³Æ
,ITPUB¸öÈË¿Õ¼ä'y:q,dLc,d2b
--properties.[value] AS
×Ö¶Î˵Ã÷
,
ShKAM_p6517
systypes.name AS
×Ö¶ÎÀàÐÍ
,
:x-q
z$[X'n6517
syscolumns.length AS
×ֶ㤶È
,ITPUB¸öÈË¿Õ¼ä3g.O
h/o}t"t:[
ISNULL(COLUMNPROPERTY(syscolumns.id,
syscolumns.name,'Scale'), 0) AS
СÊýλÊý
,
CASE WHEN syscolumns.isnullable=0
bhvB-?6517
THEN ''ITPUB¸öÈË¿Õ¼äut"t.a;w;uO*g
ELSE '
√
'ITPUB¸öÈË¿Õ¼ä)u(DZ)}�RM%M
END AS
ÊÇ·ñΪ¿Õ
,
0JH2l#K
g6_3G6517
CASE WHEN syscomments.text IS NULLITPUB¸öÈË¿Õ¼ä
S1s1~"?e\
G4}
THEN '' ELSE syscomments.text
*@,f9}4Hi
n[aNN6517
END AS
ȱʡֵ
,ITPUB¸öÈË¿Õ¼ä
x;e){H^Y
CASE WHEN COLUMNPROPERTY(syscolumns.id,
syscolumns.name, 'IsIdentity')= 1
#U/v4i5]5Q"b6517
THEN '
√
' ELSE ''
Ds(~E7] D5}6517
END AS
µÝÔö×Ö¶Î
,
2xB
kOPva(m'I6517
CASE WHEN sysindexes.name IS NULL
5HH2Y!l6^U4f,o6517
THEN ''
;Pls)[|(PegV'~\�p6517
ELSE sysindexes.nameITPUB¸öÈË¿Õ¼ä7d#]\6~?,UXh
END AS
Ë÷ÒýÃû³Æ
,ITPUB¸öÈË¿Õ¼ä�hBP+l4uN#j
CASE WHEN sysindexkeys.keyno IS NULL
T|q2dNDeY*U+^*|0U6517
THEN ''ITPUB¸öÈË¿Õ¼ä]X5FdH0V)K
ELSE
CONVERT(VARCHAR(10),sysindexkeys.keyno )
tk&]u
[P m6517
END AS
Ë÷ÒýλÖÃ
,
~'l4qDj5~Z6517
CASE WHEN sysindexes.indid=1ITPUB¸öÈË¿Õ¼äs!v{]6u"Rw*S
THEN '
¾Û¼¯Ë÷Òý
'
.kaIn1bCR�j6517
WHEN sysindexes.indid>1 AND sysindexes
Ïà¹ØÎĵµ£º
1.Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)¡¡¡¡
¡¡¡¡ SQLSERVERµÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬Òò´Ëfrom×Ó¾äÖÐдÔÚ×îºóµÄ±í£¨»ù´¡±ídriving table£©½«±»×îÏÈ´¦Àí£¬ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏ£¬±ØÐëÑ¡Ôñ¼Ç¼ÌõÊý×îÉٵıí×÷Ϊ»ù´¡±í£¬µ±SQLSERVER´¦Àí¶à¸ö±íʱ£¬»áÔËÓÃÅÅÐò¼°ºÏ²¢µÄ·½Ê½Á ......
create function comm_getpy
(
@str nvarchar(4000)
)
returns nvarchar(4000)
as
begin
declare @word nchar(1),@PY nvarchar(4000)
set @PY=''
while len(@str)>0
begin
set @word=left(@str,1)
--Èç¹û·Çºº×Ö×Ö·û£¬·µ»ØÔ×Ö·û
& ......
· ±¾ÎÄÌÖÂÛÁËÈçºÎͨ¹ýTransact-SQLÒÔ¼°ÏµÍ³º¯ÊýOPENDATASOURCEºÍOPENROWSETÔÚͬ¹¹ºÍÒì¹¹Êý¾Ý¿âÖ®¼ä½øÐÐÊý¾ÝµÄµ¼Èëµ¼³ö£¬²¢¸ø³öÁËÏêϸµÄÀý×ÓÒÔ¹©²Î¿¼¡£
1. ÔÚSQL ServerÊý¾Ý¿âÖ®¼ä½øÐÐÊý¾Ýµ¼Èëµ¼³ö
(1).ʹÓÃSELECT INTOµ¼³öÊý¾Ý
  ......
SQL ServerÊý¾Ý¿âÉè¼Æ±íºÍ×Ö¶Î
2009/02/18 12:29
1. Ôʼµ¥¾ÝÓëʵÌåÖ®¼äµÄ¹Øϵ
¡¡¡¡¿ÉÒÔÊÇÒ»¶ÔÒ»¡¢Ò»¶Ô¶à¡¢¶à¶Ô¶àµÄ¹Øϵ¡£ÔÚÒ»°ãÇé¿öÏ£¬ËüÃÇÊÇÒ»¶ÔÒ»µÄ¹Øϵ£º¼´Ò»ÕÅÔʼµ¥¾Ý¶ÔÓ¦ÇÒÖ»¶ÔÓ¦Ò»¸öʵÌå¡£ÔÚÌØÊâÇé¿öÏ£¬ËüÃÇ¿ÉÄÜÊÇÒ»¶Ô¶à»ò¶à¶ÔÒ»µÄ¹Øϵ£¬¼´Ò»ÕÅÔʼµ¥Ö¤¶ÔÓ¦¶à¸öʵÌ壬»ò¶àÕÅÔʼµ¥Ö¤¶ÔÓ¦Ò»¸öʵÌå¡£ÕâÀïµÄʵÌå¿ ......