Solved

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

Posted on 2012-03-11
5
333 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

864 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now