VS style snippets in SSMS 2012. Do they exist? - sql

I am trying to setup a simple snippet in SQL Server management studio. When I heard the word "snippet", I assume that they would work like they do in Visual Studio. By that I mean that there are variables that get filled in, etc... I am not seeing that.
Can someone tell me whether SSMS 2012 supports Visual Studio style snippets. If so, can you provide an example of a snippet that supports variable replacement.

This might be close to what your looking for. Under View->Template explorer is a list of a whole bunch of structures that you regularly use when working with, building, developing databases. You can also get to it using Ctrl+Alt+T. There are literally hundreds in there. Everything from building a view to setting up a trigger to creating XML schemas.
The really nice thing with templates is you can build your own structures that you regularly use. I have built quite of few of my own templates to hold snippets that I have acquired from the likes of Brent Ozars blitz scripts and others like the improved SP_WHO from Adam Machanic and such.
While maybe not as fancy (read interactive) as the ones you'll find in the Visual Studio projects I find them very handy.
If you use these templates there is another little feature that can be very handy. If you press Ctrl-Shift-M (or use the toolbar button that shows an A->B) you get a dialog that lets you easily replace the template parameters with your own values.
Update post research into SSMS2012
I just recently started using SSMS 2012 and see there is a new feature that I wasn't aware of. When right clicking you do in fact see the 'Insert Snippet' drop down. I understand your question better now. Apparently however, these are pretty much the same as what I posted above.

Related

How to add an XSD to SQL database project in Visual Studio 2015?

I have the following problem: I have little programming skills and this is the first time I've opened Visual Studio. My goal is to directly import an XSD schema into a preexisting SQL database or a new one. I already have the defined XSD, don't need to do it from scratch. I've researched the problem and found that is somehow possible but the workaround seems to be efficient only in previous versions of the Visual Studio.
Proposed answers: this stackoverflow question or the
walk through proposed by Microsoft. Another option is this tutorial/extensive explanation, but since I have no programming background and the last part of the tutorial was never published, it is not enough.
Do you have any ideas how to do that or if the aforementioned walk through works somehow?(I am stuck at the referencing step). Do you know any other ways to get past this in VS 2015?
Thanks!

Setting up a Database Diagram in VS2012 & SSDT?

I'm working myself through this book called Head First C#.NET as I want to get into programming.
Basically the book was written for VS2010, but since my employer has bought me a MSDN License, I decided to go for VS2012 instead.
One of the assignments in the book is to create a local database, and make a database diagram for it. Unfortunately, this functionality has been removed from VS itself from VS2012 and upwards.
I've already googled it, and read that this was replaced by SSDT. Hence, I installed SSDT but I'm still not able to view and/or create a Database Diagram.
Is the "Diagram" functionality completely deprecated from 2012 and should I be looking at something complete different to get what I want / need?
According to this post, there is no diagram support in SSDT.

Has anyone written a modern editor for Classic ASP?

I have projects I have to do in Classic ASP. It would almost be enjoyable if I could get some of the same features that visual studio has, such as intellisense for objects (I know you get some from Visual Studio if you have everything in the same file, but there are quirks with that, as well), or the dropdowns showing functions like Visual Studio. It would be especially nice if it would recognize include files and use those as well. It seems to me that enough people are still using it that someone must have written something...
It seems to me that enough people are still using it that someone must
have written something
You'd think that, but I've been looking for the same thing for a number of years, and even started trying to add the language to Netbeans, but nothing I have found yet matches what you can do in DreamWeaver.
It's a rubbish program that crashes a lot and is far too expensive, but it's about the only option I have found that is any good beyond Visual Studio (2008 or less).

How to edit default templates for database objects using VSTS 2008 Database Edition GDR Version

I'm giving Visual Studio Team System 2008 Database Edition (GDR Version) a go on a new project I'm working on and have come up against a slightly annoying problem that I am hoping someone knows how to resolve.
In a nutshell, I would like to alter the default templates used to generate database objects, particularly stored procedures. In the past, using SSMS, I have simply created my own templates which contain the formatting, default number of parameters, etc, that I would generally like to use whenever I create a new sproc. This obviously eliminates a good amount of hand coding and just "feels right" to me to have some consistency in my T-SQL code.
I've tried editing the .sql files located in ..\Microsoft Visual Studio 9.0\DBPro\Items by adding the formatting and default constructs I would like to use. Unfortunately, I haven't been able to get VSTS to recognize these changes. When I add a new stored procedure using the GUI it still uses the default stored procedure formatting.
I've tried shutting down Visual Studio and starting it back up after making these adjustments, but that doesn't seem to have any effect.
Does anyone know how to do this? I haven't been able to find any documentation on MSDN or the DBPro teams' blogs, but I have a feeling this can done. Any help or suggestions would be greatly appreciated.
Microsoft Visual Studio 9.0\DBPro\Items is a legacy directory. These are the wrong templates. The right templates are in Microsoft Visual Studio 9.0\VSTSDB\Extensions\SqlServer\Items. Editing these works, and you don't even have to close visual studio.

An alternative IDE for Sybase Powerbuilder

Does anyone know of an alternative IDE for Sybase Powerbuilder? It feels pretty clunky, after working with VS2008 and Eclipse.
If not, has anyone successfully worked with this language outside the IDE? I'm not against using a simple text editor, but I find edit-import-regenerate-test-export-edit is clunkier than simply using the Powerbuilder editor.
To date, the only tools I have had any success with are:
PowerGen, for builds (with NUnit and CruiseControl.NET)
ConTEXT, which has syntax highlighting for Powerbuilder
PBL Peeper, which has some interesting features not present in the IDE
EDIT: I added a bounty to draw some wider attention to the question. It would be a very nice thing to have, if it exists.
EDIT: Well that was disappointing. The bounty apparently did not cause even 1 new person to look at the question.
None that I'm aware of, although you could probably use a source control tool, edit in your source control repository, and Get Latest Version from the PB IDE to shorten your text editor cycle. Be warned that there are hacks required to edit anything over 128 ASCII. (My guess is that this is to allow everything Unicode to be source controlled in the most restrictive source control tools.)
As Paul said, PB12 is coming with based on the Visual Studio shell, and will include things like collapsible code blocks, Intellisense, etc.... However, for PB12, this will only be used for WPF targets and a few .NET-type targets (like assemblies), last I heard. Win32 targets will continue to use the "classic" IDE.
Good luck,
Terry.
P.S. Thanks for the PBL Peeper compliment.
The PowerBuilder IDE is clunky, but I don't think developing completely outside the PowerBuilder IDE is a good idea. I think there are just too many dependencies right now.
However, the IDE for PowerBuilder 12 will be built using Microsoft's Visual Studio Isolated Shell so it ought to be much better when that is released. Also, I believe they'll be doing away with the PBL format which ought to make source control much easier to work with.
Certainly something to watch.
What I do is right-click the object and edit source. Then I copy the text and paste it into Notepad++ to edit. I copy and paste back to PowerBuilder, then I can save and see any errors. I've got a fairly decent User Defined Language for PowerScript if anyone's interested.
Added:
Please be aware that I've seen the PB Source editor corrupt DataWindows. They were all large DataWindows. To be safe always export DataWindows to edit.
One tool that will most probably make your PB experience way better is Visual Expert, which provides a good source browser. Such a tool should have been integrated into the PB IDE a long time ago, IMHO. Only problem is that it's not free, as opposed to the other tools you mention.
Regarding using external source editors, you can probably take advantage of OrcaScript, which is a scripting language that lets you perform actions such as export and import of PB objects from outside of the IDE. It will require some effort, but you can setup a basic dev env using batch files with ORCA scripts and some additional external tools. However, this setup will lack any visual editing capabilities, which means no (feasible) GUI or DW work. If you're mostly into NVOs, it could work. But then if that's the case, why use PB in the first place?...
I too have heard PB12's use of VS will be limited to some .NET stuff, which will probably benefit only a very small portion of the PB programmers community. I'm afraid the rest of us are stuck with the awful IDE for years to come.
Other than exporting the source and editing it I don't know of another IDE for PB. One problem you may have is that the exported source contains a lot of syntax that is not documented in the manuals. The PB IDE generates this code but there is no support for creating it by hand. I think you are stuck with the PB IDE
In my modest five Years of experiences starting with Powerbuilder 5/6, now using PB 10, I tempt to :
build my own browser from the classdefinition object based on Powerbuilder
tried to use autohotkey in order to open datawindows comfortable (we have several thousands in the project and i am two-finger-driven)
truly investigated in the idea using an external editor/IDE suppoted by an autohotkey script which is undermined by sybase allowing only mouse-click-usage of PB
using Visual Expert which is neither a truly integration in the IDE, nor is really worth in analyzing datwindow/powerscript interaction
ending by build hopes on PB12 Visual Studio, which lacks - depending on compatibility issues - ...
... i came to the conclusion that there will be no chance in improving Powerbuilder to an state-of-the-art language
In my philosophy - I obtained during those years - I distinguish between two types of OOP-oriented languages:
the one that award using object-orientation like C#, Python, Ruby (C++) etc. and very much the Java-Eclipse/Netbeans-Universe does
the other one that punish using object-orientation like Powerbuilder and the old Visual Basic, for example (which is causative the OOP-Idea comes afterwards and is "plugged in").
Especially the demand that all object should always be compiled (regenerated) and that you could't work with ancestors and descandants concurrently makes it painful to use real OOP.
...In memory of the good old Unix(Solaris)/C++ days...
I was researching a replacement solution that would be similar to PowerBuilder and I came across two that caught my eye.
The first was 'React Studio' https://reactstudio.com/ which I found via Alternativeto.net .
And the second was from an ad at the top of some Google searches but it was similar enough and looked good enough at first glance for me to want to take a closer look at it, and it's called 'Servoy' https://servoy.com/ .
Still researching but I currently have React Studio at the top of our list.
The TextPad editor has a syntax definition file for PowerBuilder 6.x contributed by anr#aon.at that I downloaded for free and customized several years ago. It works fine for later versions (including 8), doing keyword color highlighting on PowerScript srx files. Editing large source files in PB could get it to crash so it's usually safer, faster and more convenient to export to srx file, edit outside the IDE then re-import.