External Tool Development for SQL Server Management Studio 2005 - sql-server-2005

Does anyone have any experience of developing external tools for SSMS 2005.
Ideally I would like to be able to interact with the query windows directly, for example, taking the query text from the window to perform some processing on it.
Any pointers in the right direction would be great.
Thanks in advance

Very late entry...
Example of how to do it here
And here too

Have you looked at Sql Server Management Objects (SMO)?
http://msdn.microsoft.com/en-us/library/ms162557.aspx

The best example of this I have seen for SSMS is SQL Prompt by Red Gate
SQL Prompt runs a seperate .NET app that sits in your systray and is in some way part of the magic of the integration.
For loading an add-in, you will want to create a key under:
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\Shell\AddIns\
...in order to have SSMS load your add-in.
Hope this helps

This link explains adding external tools to ssms with screen shots.
It also has procedure to add them as a button.
http://sqlserverlearner.com/2011/sql-server-external-tools

Related

How can I get SSMS to provide Auto Completion for SQL Azure?

I'm trying to identify a SQL Server Management Studio option (when writing/running queries) that provides table/column auto-complete functionality in the query editor. Unfortunately, SSMS seems to stop giving you Intellisense when you're connected to a SQL Azure database. Is there any way to fix this?
Are there any options, hacks, plugins or anything else that can accomplish this?
I've finally stumbled upon an option. It's non-ideal but it is certainly a huge step in the right direction!
dbForge SQL Complete is a SSMS plugin that replaces SSMS's built-in Intellisense with its own auto-complete engine. This is a HUGE improvement when connected to SQL Azure, but so far the free version feels like a step backwards when connected to traditional SQL Server instances. Overall, I think we're going to prefer using this over not using it. I'll come back in a couple days to report how well (or not) it's going.
At least it's an option, though!
New Release of SQL Server Management Studio V17.2 now support Intelliscence so no need to have any other tools for this.
Please note that this will only work in case of SQL Server Authentication, that means logged in using SA Instance.
https://connect.microsoft.com/SQLServer/feedback/details/3100677/ssms-2016-would-be-nice-to-have-intellisense-on-azure-sql-databases
Visual Studio have enabled basic IntelliSense for Azure SQL, but it isn't avalaible easily.
You have to click on table, select from drop menu DROP AND CREATE TO -> New query window and then IntelliSense will work. If you simply use New query it will not.

How to use VS2010 query designer in a solution?

Well met! I'm missing something about VS2010... I want to create a solution that let's me use the visual query designer to build queries against an SQL server, as I can when I right click the server in Server Explorer and select New Query. However, I can't seem to save this sort of query.
If I go into Solution Explorer, I can create a new TSQL query, but I cannot use the visual designer. ???
So, what am I missing? I'm sure there is some reasonable and over-arching design paradigm that is just completely eluding me as to why the Solution Explorer and Server Explorer would be so disintegrated that I could not create a query in the one and save it as part of a solution.
Thank you for your help!
It's my understanding that SQL 2008 is built in to VS2010. Therefore you shouldn't have to use SQL Server MS.

Automate Generate Scripts Wizard in SQL2008

Problem: how to automate a Generate Scripts in SQL2008 Management Studio:
ie right click on database, Tasks, Generate Scripts
All Tables
All Stored Procs
Create drop statements
Don't use USE statement
Generate data
This is a 20sec process to do by hand.. needs automating :-) I don't really want to code it in C# in SQL Server Management Objects (SMO).
Maybe I'll have to use AutoHotKey :-)
Use SMO - it's the right thing to do and you know it!
Have a look at DBSourceTools. http://dbsourcetools.codeplex.com
It's an open-source scripting engine for SQL Server Databases that uses SMO.
I've taken Will A's advice and tried scripting.. SQL Server Management Objects
nearly there :-)

How do I edit a text field (or ntext) in SQL Server 2000 or 2005 using the GUI?

Is there a way to do this with SQL Server tools?
If not, is there a 3rd party tool that does this?
There doesn't seem to be a good way to edit longer text columns in the SQL Server Managers for SQL Server 2000 or 2005. While SQL Server Manager is really not for editing data in your db, what other tool does Microsoft provide that would normally allow you to do this? Every other field is pretty easy to edit, except long text fields. In Access, you could hit shift-f2 and it would pop up a nice dialog to edit your text in.
alt text http://techinterview.org/edit.png
Generally, SQL Management Studio is an administrative tool for your database and not meant for data entry other than a quick edit here or there. Generally you would script the data or it would be entered by an application that uses the database for persistence.
(Although I have pointed Access to my SQL Server DB for a better quick and dirty UI.)
This may fight your bill - SQL LOB Editor.
The other option you might want to look at is EMS SQL Studio for SQL Server.
Marc
If you are specifically after a nice big multi-line edit dialogs, then yes you definitely need to look outside of the Microsoft SSMS line of tools. They don't support it.
This is just stupid. Enterprise Manager for SQL Server 2000 handled multiline text just fine. Just silly to go backward and loose functionality that was pre-existing. Not like it is rocket science to reproduce formatted text. Someone really dropped the ball on this one.
In the Management Console, isn't it possible to do an "Open Table" context-menu action and then edit the data from there?
I totally recommend DBVisualizer. The nice thing about it is, it supports a long list of databases and generic all JDBC Drivers (since it is written in Java). You can browse your various databases, change data and explore schema in nice graphs. It comes as a free and a personal edition for 149 $ and is totally worth it! Look at this matrix for a comparison.
You'll be able to edit text and ntext in SQL Server 2000, 2005 and surly for upcoming versions as well.
If I had to make the edits only occasionally I would probably use SQL Query Analyzer and just script the UPDATE command.
If that was too inconvenient I would next look at linking to the database in Access, and to really quick and dirty ease of use I would just use an AutoForm to generate a UI for the table. If you don't have Access I believe OpenOffice Base can connect through ODBC and has similar form building functionality.

Editing SQL query with Visual Studio 2008

Would you recommend me the best approach to edit SQL query with Visual Studio 2008 Professional, please?
I know I can open Query window from context menu in Server Explorer and edit text in SQL Pane. But unfortunately I am not allowed to save query to a file and Find and Replace commands are not working there.
Alternatively I can open text file with extension .SQL in Visual Studio editor obtaining syntax highlighting and full editing capabilities but losing possibility to execute the script.
Now I copy query text from one window to another and back but I hope there is better solution.
Many thanks for suggestions!
When I have to connect to Sql Server, I use NetBeans, as it has a number of features that make it much easier to use than Visual Studio. One of these is intellisense, which is very useful when you have an alias for a table name and lots of long field names. The general handling of connections and connection pools is also much cleaner in NetBeans. I could go on, but suggest trying it for yourself. You will almost certainly need the Sql Server jdbc driver, which can be downloaded from http://msdn.microsoft.com/en-us/data/aa937724.aspx
If you create a Database project within your solution in Visual Studio, then you can set up a default database connection for that project. Then any *.sql files that are included in the database project can be executed against that connection. What I usually do is select the text to be exectued and right-click it, then select "Run Selection".
You can set up any number of database connections under the "Database References" node in the solution explorer, and choose the one you want to run your query against.
Wow you are right, this is a real pain. Would it be acceptable for you to use a local copy of the SQL Management Studio (the name might be wrong)? You would be outside of VS but you could still edit your query and run it at the same time. Definitely not optimal but better than nothing.
Good luck.