Command Line (batch) formatting

Provides intelligent code completion for SQL Server editors.

Moderators: Anu Deshpande, Aaron Law, David Priddle

Command Line (batch) formatting

Postby Chillier » Wed Mar 19, 2014 1:58 pm

We would like to make a Jenkins task to format our SQL before committing. Is there a way to specify a "command line" command to format :?:
Chillier
 
Posts: 8
Joined: Wed Mar 19, 2014 1:17 pm
Location: Norway

Postby Aaron Law » Thu Mar 20, 2014 10:17 am

Hi Chiller,
Unfortunately there's no way to get prompt to run from the command line at the moment.

Could I ask how you'd want this to work? A command line exe that'd take in a .sql file and an exported .sqlpromptstyle file that then writes out a new formatted .sql file?

Thanks,
Aaron.
Aaron Law
 
Posts: 251
Joined: Fri Jun 28, 2013 10:56 am
Location: Red Gate Software

Postby Chillier » Thu Mar 20, 2014 10:29 am

Hei -

Thanks, but not sure. We just want to automate the action of applying a standard formatting before committing.

When we commit, we want the diff to show our actual changes, not programmer-specific formatting changes.... so we want to automagically apply the same formatting template to all SQL code.

mvh Charles
Chillier
 
Posts: 8
Joined: Wed Mar 19, 2014 1:17 pm
Location: Norway

Postby Aaron Law » Thu Mar 20, 2014 10:56 am

Are you using SQL Source Control to commit your changes?

We've had a request to automatically add prompt formatting in the commit tab on UserVoice here which sounds like it'd be exactly what you need?
Aaron Law
 
Posts: 251
Joined: Fri Jun 28, 2013 10:56 am
Location: Red Gate Software

Postby Chillier » Thu Mar 20, 2014 11:09 am

Sounds right to me - I'll have to ask if they had other motives for using Jenkins ... but sounds right to me. I'll check.
Chillier
 
Posts: 8
Joined: Wed Mar 19, 2014 1:17 pm
Location: Norway

Postby Chillier » Thu Mar 20, 2014 11:25 am

Should be OK to add formatting in the commit tab - preferably if we could specify the (standard) format template to be used. The objective would be compromised if everyone uses their own personal formatting before committing, even if automagically.
Chillier
 
Posts: 8
Joined: Wed Mar 19, 2014 1:17 pm
Location: Norway

Postby Aaron Law » Fri Mar 21, 2014 12:26 pm

Hi Charles,

I've let our SQL Source Control team know that you'd like this feature. It sounds like a really good idea, please do vote on the UserVoice request as it helps them to prioritise which features to work on next.

Thanks,
Aaron.
Aaron Law
 
Posts: 251
Joined: Fri Jun 28, 2013 10:56 am
Location: Red Gate Software


Return to SQL Prompt 6

Who is online

Users browsing this forum: No registered users and 0 guests