Format SQL Script in Visual Studio 2012

Nexus23 picture Nexus23 · Feb 21, 2013 · Viewed 7.1k times · Source

Normally we can format code or markup in visual studio with Ctrl + K + D shortkeys.

How we can format SQL script code like stored procedures or views or other things using shortkeys?

Note: I am using SSDT with VS2012, where I can edit scripts of a database, but I can't find format option.

Answer

Peter Schott picture Peter Schott · May 1, 2013

I don't think there's a built-in SQL Format option for SSDT. You can use a plug-in such as Red-Gate's SQL Prompt to get that functionality, but I don't think there's a native option for formatting SQL at this time.