SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Skip header code when Formatting?

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Skip header code when Formatting?
Author Message
mksql



Joined: 29 Dec 2006
Posts: 19
Country: United States

Post Skip header code when Formatting? Reply with quote
We have a standard set of header code for scripts that generate database objects. These are basically the same as the IF NOT EXISTS clauses generated by SSMS ("IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'...') AND type in (N'U'))"). For each object type (table, procedure, function, etc.) the header code follows a set pattern.

I would like to keep these headers compact, and on a single line, thus not subject to the same formatting rules as the SELECT statements in the body of the code. Is there a way to "skip" these initial header lines, and only apply formatting to the script body?
Thu Feb 19, 2009 2:29 pm View user's profile Send private message Yahoo Messenger
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
You can try disabling IF NOT EXISTS formatting rule and creating a new one for "IF NOT EXISTS (SELECT * FROM " and so on. With a certain degree of customization for this and related rules you can probably get it to do what you want, but that may take a while.

An easy solution is to do a global replace for "IF NOT EXISTS (SELECT * FROM" with "-- IF NOT EXISTS (SELECT * FROM" to convert these lines into comments, reformat the code and then run another replace to remove these comments.
Thu Feb 19, 2009 3:05 pm View user's profile Send private message
alperbb



Joined: 01 Apr 2009
Posts: 1
Country: Turkey

Post sql server management studio query execution problem Reply with quote
Hi,

I am using trial version of sql assistant that is new released version v4.6.12. While using sql assistant in Sql server management studio I am writing select query in case of the table has data it does not return any result set. only the message that is command executed succesfully is printed out. but some times it executes the query and return the resultset. does it a bag of new version or it has any options inside of the tool that is related to solve this problem...
while it does not return any resultset I am trying to close connection of sqlserver management studio then reconnect and execute query it return result set i had this problem untill I inistall this tool...
exp:
below the the table1 has 100 row 5 column but when I try to execute this qery on sqlserver management studio with sql assistant tool it has no resutset

Code:
 select top 10 * from table1

Wed Apr 01, 2009 2:22 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
If the connection is slow (or SQL Server is slow) it might take some time to run the real-time syntax check which is done after each pause after new typing. Please wait for a few seconds and then try executing your code again.

If your server is very slow, it makes sense to disable the real-time syntax check feature.
Wed Apr 01, 2009 5:24 pm View user's profile Send private message
lmfs



Joined: 01 Apr 2009
Posts: 9
Country: Sweden

Post Reply with quote
Hmm... This sounds like the "Query Analyzer" thread (what alperbb wrote). Empty resultsets, disconnections.
Fri Apr 03, 2009 5:16 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.