How to use VS2010 query designer in a solution? - sql

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.

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.

Save Data from WinForms Controls to a SQL Server Database

So I am just getting started with this. New to .NET, SQL Server, C#, VB.NET, etc and the closest thing I have to related to this is some experience with MS Access and the VBA that relates to that and MS Office automation.
So I do have Visual VB.NET 2008 Express installed, SQL Server 2005 express installed, and I do know how to start a brand new project in VB.NET, and then add the database to the solution explorer, modify the tables/fields, etc. I know how to create a WinForm, add some controls (and name them and whatnot).....
So in MS Access I know how to use VB in the Code-Behind-Form to use the form in an unbound manner, and insert data into the tables via Visual Basic with SQL statements. I am looking to be able to begin the same sort of thing here, because I guess I have to start somewhere?
This may be a bit overwhelming, but I'd start with the videos here: http://windowsclient.net/learn/
and in particular, look for the data videos at the bottom of this page.
http://windowsclient.net/learn/videos.aspx

Proj.NET and Sql Server 2008

I have found this project on Codeplex.
http://www.codeplex.com/ProjNET
I need to integrate this code with Sql Server 2008, and found a similar project on the Web
http://sqlspatialtools.codeplex.com/
The second one can be bound to Sql Server. What do i need to do, to "bind" the first one, the same way as the first?
EDIT using code like create assembly and functions in Sql Server, Sql Spatial tools is bound to SQL.
I'm not sure i made myself clear, but if i take the same approach, all i need is to register the first one, the same way as the second?
http://sqlspatialtools.codeplex.com/sourcecontrol/changeset/view/23749?projectName=sqlspatialtools#255008 (check SQL Scripts->register.sql)
Any light on this matter?
Thank you everyone.
Studying the .sql file on Sql Spatial tools em and another friend was able to find the correct pathway that we needed.
We builded a function on ProjNet API, and then in Sql Server 2008 we did this:
create assembly ProjNET 'pathToFile'
go
create function ourFunction(signature) returns geography
as external projnet.ourNamespace.Function
Thanks for the attention everyone.
G.

External Tool Development for SQL Server Management Studio 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

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.