November 14, 2018 at 11:58 pm
Comments posted to this topic are about the item T-SQL Decommenter Part II
November 15, 2018 at 12:03 am
Or using powershell and regex
([regex]"(?im)--.*?$").replace(([regex]"(?s)\/\*.*?\*\/").replace($sql, ""), "")
November 17, 2018 at 10:47 am
will 58232 - Thursday, November 15, 2018 12:03 AMOr using powershell and regex([regex]"(?im)--.*?$").replace(([regex]"(?s)\/\*.*?\*\/").replace($sql, ""), "")
That will work much of the time, but here are a couple of examples that will get mangled:
([regex]"(?im)--.*?$").replace(([regex]"(?s)\/\*.*?\*\/").replace("SELECT '-- in string'", ""), "")
([regex]"(?im)--.*?$").replace(([regex]"(?s)\/\*.*?\*\/").replace("/*SELECT /*'Nested'*/'Commented'`r`n*/`r`nSELECT 'Uncommented'", ""), "")
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy