Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tool for sql refactoring? [closed]

Is there a refactoring tool available for SQL (TSQL in particular). Is there any tool that can do automatic simplification of SQL?

I have a set of views where only the top two are used, and I'd like to refactor this into only two views, hence 10+ queries into two queries.

like image 586
C. Ross Avatar asked Jan 23 '23 00:01

C. Ross


2 Answers

Try ApexSQL Refactor

ApexSQL Refactor is a FREE SSMS and VS add-in, for formatting SQL statements using nearly 200 formatting options and 11 code refactors. It expands wildcards, qualifies object names, renames SQL database objects and parameters without breaking dependencies, encapsulates code as a stored procedure, scalar function, table function, and view, add surrogate keys and more

Disclaimer: I work for ApexSQL as a Support Engineer

like image 167
Milica Medic Kiralj Avatar answered Jan 24 '23 14:01

Milica Medic Kiralj


Red-Gate Software has a tool called SQL Refactor which should do what you're looking for.

Update. as BlueRaja correctly states - SQL Refactor has been discontinued as a separate product, and its functionality is now integrated into SQL Prompt (which is a great tool in itself, and well worth the money for its license!)

like image 45
marc_s Avatar answered Jan 24 '23 12:01

marc_s