Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 make code sexy

Author  Topic 

oded_r
Starting Member

1 Post

Posted - 2011-01-06 : 04:50:45
i have some scripts in the sql but they not write properly

i want transform the "select"-> "SELECT" or "where" -> "WHERE"

and also if there something who do that -

SELECT * FROM #TABLE WHERE 1=1 -> SELECT *
FROM #TABLE
WHERE 1=1


10 X


Lumbago
Norsk Yak Master

3271 Posts

Posted - 2011-01-06 : 05:08:53
Hehe...."how to sexify your sql code :D"

You should look up SQLPrompt from Redgate, it's a plugin to management studio and widely used. Alternatively you can use this site which is free for limited use: http://www.sqlinform.com/free_online_sw.html

- Lumbago

My blog (yes, I have a blog now! just not that much content yet)
-> www.thefirstsql.com
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-01-06 : 05:36:59
If you want to "clean up" exist SQL code (e.g. code which is stored in files, or you can Cut & Paste into a cleanup-form) then have a Google for "SQL beautifier"
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-01-06 : 07:40:05
Bah! No need for paid tools or Google searches: http://weblogs.sqlteam.com/mladenp/archive/2010/12/28/ssms-tools-pack-1-9-4-is-out-now-with.aspx
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2011-01-06 : 11:53:02
quote:
Originally posted by robvolk

Bah! No need for paid tools or Google searches: http://weblogs.sqlteam.com/mladenp/archive/2010/12/28/ssms-tools-pack-1-9-4-is-out-now-with.aspx

That tool does some nice things. If you only need to upper or lower case some reserved words, then it works great. If you need to format your code too, then you'll have to use something else.
Go to Top of Page
   

- Advertisement -