Solved

Does VS or SQL Management Studio have a GUI for creating SQL queries?

Posted on 2012-03-11
5
335 Views
Last Modified: 2012-03-12
I came across this query:

UPDATE [dbo].[Products] SET [ProductName] = @ProductName, [SupplierID] = @SupplierID, [CategoryID] = @CategoryID, [QuantityPerUnit] = @QuantityPerUnit, [UnitPrice] = @UnitPrice, [UnitsInStock] = @UnitsInStock, [UnitsOnOrder] = @UnitsOnOrder, [ReorderLevel] = @ReorderLevel WHERE (([ProductID] = @Original_ProductID) AND ([ProductName] = @Original_ProductName) AND ([SupplierID] = @Original_SupplierID) AND ([CategoryID] = @Original_CategoryID) AND ([QuantityPerUnit] = @Original_QuantityPerUnit) AND ([UnitPrice] = @Original_UnitPrice) AND ([UnitsInStock] = @Original_UnitsInStock) AND ([UnitsOnOrder] = @Original_UnitsOnOrder) AND ([ReorderLevel] = @Original_ReorderLevel))

Open in new window


And it seems so detailed that I question whether it was generated by a human or a program. Does VS or SQL Management Studio have some GUI for creating SQL queries?
0
Comment
Question by:Eindoofus
  • 3
5 Comments
 
LVL 33

Expert Comment

by:Norie
ID: 37707513
SMSS does, the Design Query Editor under Query.

Not sure about VS, it's got something but not sure if it's really a query editor.

By the way, I would think that SQL could have been 'generated' by a human using code they  created.

For example some sort of function that you pass the fields to and it returns the SQL, or at least part of it.

There might even be another function for the criteria part.
0
 
LVL 25

Accepted Solution

by:
jogos earned 500 total points
ID: 37707624
In SSMS when you select a table and right click you can choose also to have a script created for insert/update/select
0
 
LVL 40
ID: 37707769
There is also one in Visual Studio, but you need to create a Data Connection first.

If it is not already visible along the Toolbox, activate the Server Explorer from the View menu.

In the Server Explorer, right click on Data Connections, Add Connection et fill in the necessary information for a Microsoft SQL Server (SqlClient)  Data source.

Your database will appear in the Server Explorer, and from there, you have access to all the tools that a programmer could need. The tools specific to a DBA such as creating roles are not there, but those for the programmer are all there. You could even create a new database if needed. You can even link to the SQL Server Debugger so that you can step into your stored procedures to debug them as if they where methods.

Naturally, you need the proper rights on the server and the database.
0
 
LVL 33

Expert Comment

by:Norie
ID: 37707774
James

Knew it was something like that, just not used VS for that kind of thing recently.
0
 
LVL 33

Expert Comment

by:Norie
ID: 37710119
I thought the question was about SSMS or VS having a GUI, not shortcuts to generate queries?
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question