Solved

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

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to query date ranges with SQL 6 23
Set form below another form 3 25
Getfiles in vb.net 21 12
Saveas need to save a copy 16 9
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

707 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

17 Experts available now in Live!

Get 1:1 Help Now