Not sure if the following questions have been answered on this forum already but a reply nonetheless would be much appreciated. Following are my questions:

1. Is it possible to export the SQL Assistant settings to a file and then import that settings file into other instances of SQL Assistants?

2. I use MS Management Studio as my default editor and I would like my insert statements to look like this -

insert into PERSON (Name, Gender) values ('Adam', 'Male')

instead of

insert into PERSON
(
Name,
Gender
)
values
(
'Adam',
'Male'
)

I have already tried to change the 'formatting rules' under 'code formatting' tab but it doesnt seems to work at all. I have entered this rule: INSERT ... (..., ...) VALUES (..., ...)

Thanks for your reply.

Sun Apr 06, 2008 10:51 pm

SysOpSite Admin

Joined: 26 Nov 2006Posts: 6787

Hi,

1. All settings are saved in sqlassist.sas file which is a text file. The file can be copied entirely to a different computer.

2. Just a guess, with MS Management Studio (SSMS) you run SQL Assistant as a plug-in, while you make changes in a separate place using the system tray icon for SQL Assistant. That icon can be used to make global changes only. As a result not all of your global changes have affect on the SSMS. The solutions are very simple - use either the Options menu in the SQL Assistant's menu within SSMS or unregister the plug-in and run only the system tray instance.

Also note that formatting rules are used mostly when formatting the code, not when you are typing it, although some have both scopes.

2+ By the way, there exists another method for controling SQL statement layout for typing. For example, create a code snippet with the name INS and set it to be activated after Ctrl+Space or just space typed after INS letters. Specify for this snippet text something like the following

Code:

INSERT $OBJECT$ ($COLUMNS$) VALUES ($COLUMNS)

Give it a try and check if that works for you.

Mon Apr 07, 2008 1:46 am

ja

Joined: 06 Apr 2008Posts: 2Country: New Zealand

Thanks for point 1, it works quite well. Point 2 however, does not work for me. I am making changes to the plugin in Management Studio. The formatting works how it is supose to only when I highlight the code and then press Ctrl+F11 (default configuration). It seems like the formatting is not supose to work while you are typing like you suggested. Atleast it seems that way for INSERT statements. Is there any way by which this feature could be added to future releases i.e. an option that allows auto formatting while typing?