_ | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁
FrontPage › 貎朱Μ一危覦覯企覦覯

Contents

1 quotename() 伎蠍
2 蠏谿朱..


1 quotename() 伎蠍 #

貎朱Μ襯 燕る慨覃 一危 覦 襷 願 . 殊語 貎朱Μ覓語 燕螻 覲企 . 企蟆 一危 覦 蟆曙磯 quotename() 伎 SQL 燕覃 譬 蟆 SQL 焔覩襦 れ 蟆企.

declare @sql nvarchar(255)
set @sql = 
	'select * from sys.objects where name like ' + 
	quotename('%', '''') + '+' +
	quotename('sysdiagrams', '''') + '+' +
	quotename('%', '''')
print @sql
exec(@sql)

--select * from sys.objects where name like '%'+'sysdiagrams'+'%'

2 蠏谿朱.. #

quotename() ルГ螳覲螳 2螳. 蟆 蠏谿朱 襯 襷る .

CREATE FUNCTION dbo.quotestring(@str nvarchar(1998)) RETURNS nvarchar(4000) AS
BEGIN
   DECLARE @ret nvarchar(4000),
                 @sq  char(1)
   SELECT  @sq = ''''
   SELECT  @ret = replace(@str, @sq, @sq + @sq)
   RETURN(@sq + @ret + @sq)
END
蠍 蠍郁鍵..
企: : るジ讓曙 襦螻豺 企Ν 譯殊語. 襦螻豺
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2018-04-13 23:12:52

企ゼ れ蟆 觜蟲讌 蠍 (れ)