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)
 SSMS - can it do code folding?

Author  Topic 

marty1976
Starting Member

22 Posts

Posted - 2011-08-25 : 04:36:04
Hi,

can SSMS 2005 do code folding? I know there's SSMStoolspack, but can't it do otherwise?
I heard SSMS 2008 can - can I use SSMS 2008 with SQL-Server 2005 servers?

Regards
Marty

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-25 : 04:49:42
you can use SSMS 2008 with sql 2005 servers.
what do you mean by code folding?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-08-25 : 05:00:48
I'm presuming Code Folding is an editor that can put a [+] / [-] next to things like IF blocks so that they can be condensed/expanded to make long code more easily scrolled?

If so I would be bothered that my code was too long if I needed code-folding for SQL. We use Stored Procedures and Triggers, each of which is modest enough to be easily readable - even though the application itself is massive.
Go to Top of Page

marty1976
Starting Member

22 Posts

Posted - 2011-08-25 : 05:40:38
Well, at my place there are SPs, FNs,... that easily have 800 LOC, condensing parts of the code while developing would sometimes make it easier to scroll...
I'll check if we have 2008 licenses...
Edit: Can I use SSMS 2008 Express together with Server 2005 Std and Enterprise?
Can different SSMS versions be installed in parallel?
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-08-25 : 06:06:02
I think installing different SSMS client versions is tricky.

However, SQL2008 client tools should be able to do everything, and connect to everything, that the SQL2005 client tools can.

The Express SSMS tools, from memory, don't have the features to deal with Backups - and probably some other things too.

Could you install SSMS SQL 2008 on a don't-care machine and try from that?
Go to Top of Page

marty1976
Starting Member

22 Posts

Posted - 2011-08-25 : 07:38:38
I read that SSMS Express Tools are limited in some ways, but IMHO I could live with that.
I'll install SSMS 2008 Express on a VM to test it and report back...
Go to Top of Page

marty1976
Starting Member

22 Posts

Posted - 2011-08-25 : 12:07:07
Well, I read that SSMS 2008 can do code folding, but it seems I was wrong:
IntelliSense is only available if SSMS is connected to an instance of SQL Server 2008 or newer.
IntelliSense is NOT available for SQL Server 2005 and older.

Connecting to 2005 std and enterprise servers and executing queries is fine though...
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-08-25 : 12:26:14
quote:
Originally posted by marty1976

Well, I read that SSMS 2008 can do code folding, but it seems I was wrong:
IntelliSense is only available if SSMS is connected to an instance of SQL Server 2008 or newer.
IntelliSense is NOT available for SQL Server 2005 and older.

Connecting to 2005 std and enterprise servers and executing queries is fine though...



Not correct. It is available and works against SQL 2005.

Go to TOOLS/OPTIONS/Text Editor/Transact-SQL/Intellisense

Enable Intellisense and tick the Outline Statements box.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-08-25 : 13:01:35
Is IntelliSense the same as Code Folding in this context?

I thought IntelliSense was just the auto-complete predictive-text that the editor trying to help you with
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-08-25 : 13:04:43
"I thought IntelliSense was just the auto-complete predictive-text that the editor trying to help you with" that's what I think of Intelisense as too, but that's where the setting is in SSMS

Can leave "Autolist Members" unchecked in the General tab if you don't want the IntelliSense on.

The Outline Statements option is what the OP is referring to as Code Folding.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-08-25 : 15:22:21
Thanks Russell ... good to know ... hopefully I can sell that nugget of information in a consultancy session - you know the drill: "Lend me your watch and I'll tell you the time ... and send you a bill" !
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-08-25 : 23:51:31
LOL Kristen! Love it!

Trust me, I'm selling a lot of what I've learned here.
Go to Top of Page

marty1976
Starting Member

22 Posts

Posted - 2011-08-26 : 02:59:54
@russel: I already had the "Outline Statements" ticked in the Intellisense options of the text editor for TSQL, but it just won't work. Furthermore, MS confirms hat it doesn't work against Server 2005 (which I tested with both Server 2005 Standard and Enterprise). I was citing a (German) msdn source that I translated on the fly: http://msdn.microsoft.com/de-de/library/ms173434.aspx
"IntelliSense ist nur verfügbar, wenn der Database Engine (Datenbankmodul)-Abfrage-Editor mit einer Instanz von SQL Server 2008 Database Engine (Datenbankmodul) verbunden ist. IntelliSense ist nicht verfügbar, wenn der Abfrage-Editor mit früheren Versionen von Database Engine (Datenbankmodul) verbunden ist."

US-en Version: "When IntelliSense Is Unavailable"
http://msdn.microsoft.com/en-us/library/ms173434.aspx
"IntelliSense is only available when the Database Engine Query Editor is connected to an instance of the SQL Server 2008 Database Engine. IntelliSense is not available when the Query Editor is connected to earlier versions of the Database Engine."

@Kristen: IntelliSense is the component doing the code folding as well as auto-completion...
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-08-26 : 03:11:21
"@Kristen: IntelliSense is the component doing the code folding as well as auto-completion..."

Thanks. Older and Wiser and its only 8am today!

I suppose using an external editor is out of the question?

(FWIW we have all our database Sprocs / Triggers etc in individual files on disk, and use SVN revision control system to manage them. I still use Query Analyzer (because of decades of familiarity, mostly) ... but I can use any editor - I use my normal Programmers Editor for big Find & Replace operations, for example.)
Go to Top of Page

marty1976
Starting Member

22 Posts

Posted - 2011-08-26 : 04:24:22
I think this is what I'll do... Notepad++ with nppexec comes to mind...
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-08-26 : 10:53:44
quote:
Originally posted by marty1976

@russel: I already had the "Outline Statements" ticked in the Intellisense options of the text editor for TSQL, but it just won't work. Furthermore, MS confirms hat it doesn't work against Server 2005 (which I tested with both Server 2005 Standard and Enterprise). I was citing a (German) msdn source that I translated on the fly: http://msdn.microsoft.com/de-de/library/ms173434.aspx
"IntelliSense ist nur verfügbar, wenn der Database Engine (Datenbankmodul)-Abfrage-Editor mit einer Instanz von SQL Server 2008 Database Engine (Datenbankmodul) verbunden ist. IntelliSense ist nicht verfügbar, wenn der Abfrage-Editor mit früheren Versionen von Database Engine (Datenbankmodul) verbunden ist."

US-en Version: "When IntelliSense Is Unavailable"
http://msdn.microsoft.com/en-us/library/ms173434.aspx
"IntelliSense is only available when the Database Engine Query Editor is connected to an instance of the SQL Server 2008 Database Engine. IntelliSense is not available when the Query Editor is connected to earlier versions of the Database Engine."

@Kristen: IntelliSense is the component doing the code folding as well as auto-completion...

Works fine for me using SSMS 2008 against SQL 2005.
Go to Top of Page

marty1976
Starting Member

22 Posts

Posted - 2011-08-29 : 02:52:10
quote:
Originally posted by russell
Works fine for me using SSMS 2008 against SQL 2005.

Can you please tell me the exact versions of SSMS and server 2005 you use?
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-08-29 : 07:49:01
SSMS:
Microsoft SQL Server Management Studio 10.0.1600.22 ((SQL_PreRelease).080709-1414 )
Microsoft Data Access Components (MDAC) 2000.085.1132.00 (xpsp.080413-0852)
Microsoft MSXML 2.6 3.0 5.0 6.0
Microsoft Internet Explorer 7.0.5730.13
Microsoft .NET Framework 2.0.50727.3603
Operating System 5.1.2600

Works for me with SQL2k5 EE and DE SP3 9.00.4220.00
Go to Top of Page

marty1976
Starting Member

22 Posts

Posted - 2011-08-31 : 06:02:14
SSMS:
Microsoft SQL Server Management Studio 10.0.1600.22 ((SQL_PreRelease).080709-1414 )
Microsoft Data Access Components (MDAC) 2000.085.1132.00 (xpsp.080413-0852)
Microsoft MSXML 2.6 3.0 6.0
Microsoft Internet Explorer 8.0.6001.18702
Microsoft .NET Framework 2.0.50727.3620
Betriebssystem 5.1.2600
Doesn't work for me with SQL2k5 EE...
The only difference I see is that on my machine I don't have MSXML 5.0 installed...
Go to Top of Page
   

- Advertisement -