JOIN sys.sql_modules AS m ON m.object_id = Add. $procQuery = + N'.' + QUOTENAME(p.name) AS ProcedureName # Url of .圆4 in official Microsoft NuGet repository. You could use a package manager instead for that task. This version will download the assembly from NuGet if .dll doesn't already exist in the specified location. LEFT OUTER JOIN CTE_CommentBlocks AS B ON B.procname = S.procname AND S.LineNumber BETWEEN B.CommentStart AND B.CommentEndīelow is a PowerShell example that uses the to parse procs and identify those with BEGIN TRAN statements. , CommentedOut = CASE WHEN B.procname IS NOT NULL THEN 'Y' ELSE 'TRANSACTION' END (Be sure Use text field: is selected from the dropdown.). PIVOT (MIN(LineNumber) FOR LineType IN (CommentStart, CommentEnd)) AS P Create a database for WordPress on your web server, as well as a MySQL (or MariaDB) user who has. SELECT procname, CommentStart, CommentEndįROM (SELECT procname, LineType, LineNumber FROM CTE_Split WHERE LineType IN ('CommentStart', 'CommentEnd')) AS S WHEN T.Item LIKE '%COMMIT%' AND NOT(T.Item LIKE '%-%COMMIT%') THEN 'TransactiionCommit'ĬROSS APPLY. If the character set and collation are not specifically set, the database defaults at the. WHEN T.Item LIKE '%ROLLBACK%' AND NOT(T.Item LIKE '%-%ROLLBACK%') THEN 'TransactionRollback' Procedure parameters can be declared with any character set/collation. WHEN T.Item LIKE '%BEGIN TRAN%' AND NOT(T.Item LIKE '%-%BEGIN TRAN%') THEN 'TransactionStart' WHEN T.Item LIKE '%-%COMMIT%' THEN 'Commented' WHEN T.Item LIKE '%-%ROLLBACK%' THEN 'Commented' WHEN T.Item LIKE '%-%BEGIN TRAN%' THEN 'Commented' WHEN T.Item LIKE '%*/%' THEN 'CommentEnd' , LineType = CASE WHEN T.Item LIKE '%/*%' THEN 'CommentStart' ** NOTE: Using dbo.DelimitedSplit8K by Jeff Moden DECLARE AS TABLEĮXEC dbo.AR_Cleanup_MoveEqualAndOppositeSBPLiabilities DECLARE DBCursor CURSOR FOR -Pick the list of all database SELECT QUOTENAME ( name) from sys. You just need to change it to use sys.sql_modules to sub in for the procname and proccode portions. It relies on dbo.DelimitedSplit8K by Jeff Moden which you can find here Here is a solution that I put together that worked, at least in my testing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |