x

SQL SCRIPT FORMATTER

Hi All, Warm wishes from shalabh saxena.

I want to make a SQL script formatter using C#,ASP DOT NET. Can any one give me breif idea about this. Fairly say i do not know much about this even how to start on this. i just have good knowledge of C#, ASP DOT NET and SQL 2008.

Please give me clear idea.
more ▼

asked Feb 09, 2012 at 02:35 PM in Default

shalabh21 gravatar image

shalabh21
51 9 11 12

(comments are locked)
10|1200 characters needed characters left

2 answers: sort newest

I am not sure why you would want to attempt such a complex task but, if you are still going to do it anyways, then the starting point would be to parse the given SQL and validate that it is correct and then tokenize it into keywords.

I did a quick google search and found the following links: Google CodeProject [Devioblog][3]

[3]: http://devio.wordpress.com/2009/06/29/parsing-sql-into-xml-and-c-objects/
more ▼

answered Feb 09, 2012 at 03:45 PM

hemanth.damecharla gravatar image

hemanth.damecharla
30 1

Hi Hemanth,

actaully i want to do some thing special for my company in and some innovative
Feb 09, 2012 at 03:47 PM shalabh21
Hi, I think you will not receive much help from here as this site is related to the SQL Server and not the General Development. AS @hemanth.damecharla mentioned, you should take a look on sites like Code Project, Stack Overflow etc. To achieve really good formatting, it's quite complex task.
Feb 09, 2012 at 06:11 PM Pavel Pawlowski
thanks pavel...
Feb 09, 2012 at 07:36 PM shalabh21
(comments are locked)
10|1200 characters needed characters left

There are already a number of tools out there that do this. You might want to take a look at them. There's SSMS Tools Pack, TSQL Prettifier, and my company's product, [SQL Prompt][3]. I think there are a couple of others as well. The first two in the list are free.

[3]: http://www.red-gate.com/products/sql-development/sql-prompt/
more ▼

answered Feb 09, 2012 at 03:35 PM

Grant Fritchey gravatar image

Grant Fritchey ♦♦
103k 19 21 74

Hi Grant, Thanks for response. actualy i want to make create my own tool. so for this i requrire some intiall help from your side guys...

so if any one give me some brief idea it will much appriciated.
Feb 09, 2012 at 03:46 PM shalabh21
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x991
x738
x23

asked: Feb 09, 2012 at 02:35 PM

Seen: 1150 times

Last Updated: Feb 09, 2012 at 07:43 PM