开发者

Finding T-SQL code with literal strings for localization project

开发者 https://www.devze.com 2023-02-13 05:22 出处:网络
Does anyone have experience with tools/techniques that 开发者_运维百科would help identify T-SQL code with literal strings (that may require language translation for a localization project)?Would love

Does anyone have experience with tools/techniques that 开发者_运维百科would help identify T-SQL code with literal strings (that may require language translation for a localization project)? Would love to leverage another's experience that may save me time developing my own tool or - god forbid - doing it manually.


Just an idea, but you could do something like this:

SELECT
    OBJECT_NAME(id),
    [text]
FROM
    syscomments
WHERE id IN (
    SELECT id
    FROM syscomments 
    WHERE [text] LIKE '%''%''%' 
    AND OBJECTPROPERTY(id, 'IsProcedure') = 1 
    GROUP BY id
)

That will show every procedure with a constant string literal in it.

Of course, if you use too many dynamic SQL execution statements, you'll get a lot of false positives...

Hope it helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消