{"id":214,"date":"2011-05-24T12:42:48","date_gmt":"2011-05-24T12:42:48","guid":{"rendered":"http:\/\/eldar.pro\/?p=214"},"modified":"2019-07-18T22:12:35","modified_gmt":"2019-07-18T22:12:35","slug":"%d0%bf%d0%be%d0%b8%d1%81%d0%ba-%d0%b2%d1%85%d0%be%d0%b6%d0%b4%d0%b5%d0%bd%d0%b8%d1%8f-%d0%b7%d0%b0%d0%b4%d0%b0%d0%bd%d0%bd%d0%be%d0%b9-%d0%bf%d0%be%d1%81%d0%bb%d0%b5%d0%b4%d0%be%d0%b2%d0%b0%d1%82-2","status":"publish","type":"post","link":"https:\/\/eldar.pro\/?p=214","title":{"rendered":"Search for occurrences of a character sequence in the procedures"},"content":{"rendered":"<p>When migrating a database from SQL Server 2000 to SQL Server 2005, it became clear that the line<\/p>\n<pre data-enlighter-language=\"sql\"><code class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">RAISERROR ('test error %S', 16, 1, @test)\n<\/code><\/pre>\n<p>due to wrong written %S instead of %s SQL Server 2000 simply works wrong (returns only the first character of the parameter), but SQL Server 2005 does not create a procedure:<br \/>\n<em>Msg 2787, Level 16, State 1, Line 6<\/em><br \/>\n<em> Invalid format specification: &#8216;%S&#8217;.<\/em><\/p>\n<p>Because such writing could occur in any procedure, we can find them all::<\/p>\n<pre data-enlighter-language=\"sql\"><code class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">SELECT name FROM sys.procedures WHERE CHARINDEX ( '%S', OBJECT_DEFINITION(object_id) COLLATE Latin1_General_CS_AS) &gt;0<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>When migrating a database from SQL Server 2000 to SQL Server 2005, it became clear that the line RAISERROR (&#8216;test error %S&#8217;, 16, 1, @test) due to wrong written %S instead of %s SQL Server 2000 simply works wrong (returns only the first character of the parameter), but SQL Server 2005 does not create a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[],"class_list":["post-214","post","type-post","status-publish","format-standard","hentry","category-s-sql-server-en"],"_links":{"self":[{"href":"https:\/\/eldar.pro\/index.php?rest_route=\/wp\/v2\/posts\/214","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eldar.pro\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eldar.pro\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eldar.pro\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eldar.pro\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=214"}],"version-history":[{"count":3,"href":"https:\/\/eldar.pro\/index.php?rest_route=\/wp\/v2\/posts\/214\/revisions"}],"predecessor-version":[{"id":482,"href":"https:\/\/eldar.pro\/index.php?rest_route=\/wp\/v2\/posts\/214\/revisions\/482"}],"wp:attachment":[{"href":"https:\/\/eldar.pro\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eldar.pro\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eldar.pro\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}