Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2012-03-11
5
Medium Priority
?
343 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 35

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 2000 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 35

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 35

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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

618 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