How to run an SQL query in Server Explorer IDE

  • Thread starter Thread starter Don Peters
  • Start date Start date
D

Don Peters

I'm running Visual Studio .NET 2002 Pro and have several database
connections that work fine under program control.

But I'd like to manually compose an SQL query while in Server Explorer and
have it executed. This seems like it should be simple, but I just can't seem
to find out how to do it. The "help" describes an "SQL Pane", but really
doesn't say how to get it displayed. I was able to bring up a Query toolbar,
but its always disabled.

My MSDE has been upgraded to SP3.

Seems like I'm missing some little stupid thing, but I just can't figure out
what it is.

Can anyone help?

Don
 
That's why Qury analyzer exists (but it only comes with SQLServer)
In VS.Net you can do this (but it's pretty akward):
- navigate to any table node in the server explorer and dbl click it
- You should now have a "query" toolbar visible . You can recognize it
because it has a "Change type" drop down menu on it. ANyway, there is
a little ison that say "sql" on that toolbar. click it and you're in
SQL view on that table. Feel free to change the SQL and run the
procedure again.

Another (easier) way - use a tool called "SQL Buddy"[1] which mimick a
lot of the features in the Query analyzer, is completly free, and
works against MSDE databases as well.

[1] http://sqlbuddy.sourceforge.net/
 
Thanks Roy! You're right, it does work, and it sure seems awkward.

Don


Roy Osherove said:
That's why Qury analyzer exists (but it only comes with SQLServer)
In VS.Net you can do this (but it's pretty akward):
- navigate to any table node in the server explorer and dbl click it
- You should now have a "query" toolbar visible . You can recognize it
because it has a "Change type" drop down menu on it. ANyway, there is
a little ison that say "sql" on that toolbar. click it and you're in
SQL view on that table. Feel free to change the SQL and run the
procedure again.

Another (easier) way - use a tool called "SQL Buddy"[1] which mimick a
lot of the features in the Query analyzer, is completly free, and
works against MSDE databases as well.

[1] http://sqlbuddy.sourceforge.net/

---
Regards,

Roy Osherove
www.iserializable.com


I'm running Visual Studio .NET 2002 Pro and have several database
connections that work fine under program control.

But I'd like to manually compose an SQL query while in Server Explorer and
have it executed. This seems like it should be simple, but I just can't seem
to find out how to do it. The "help" describes an "SQL Pane", but really
doesn't say how to get it displayed. I was able to bring up a Query toolbar,
but its always disabled.

My MSDE has been upgraded to SP3.

Seems like I'm missing some little stupid thing, but I just can't figure out
what it is.

Can anyone help?

Don
 
Hi Roy,

It might seem a little awkward because that is one of the obscure ways of
getting to the SQL pane in the query designer. Do the following in the
future for a better experience:

1. In Visual Studio, add a project called 'Database Project' (You can find
this in the 'New Project' dialog located at 'Other Projects --> Database
Projects --> Database Project'
2. Choose an existing data connection (or add a new data connection) for the
database project
3. Once you add the Database Project, you will see that there is a folder
called 'Queries'. Right-click on it and choose 'Add Query'
4. A query designer window opens and you can graphically design the query
(i.e. develop the SQL) that you want. If you are a SQL expert (or if you
already have the SQL text written), then just type (or cut and paste) the
SQL text into the SQL pane.
5. You can then run the query to view the results.

There is another way, you can achieve the functionality (at least some of
the functionality you would see in the Query Analyzer).
1. Once you add the Database Project, you can right-click on any of the
folder and choose 'Add SQL Script'
2. In the Script editor that opens you can type in the SQL text and run the
SQL (or run a part of the SQL).

Let me know if this helps.

Thanks!
Srinivas Kanakapally
Visual Studio .Net Data Tools, MSFT

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.

Don Peters said:
Thanks Roy! You're right, it does work, and it sure seems awkward.

Don


Roy Osherove said:
That's why Qury analyzer exists (but it only comes with SQLServer)
In VS.Net you can do this (but it's pretty akward):
- navigate to any table node in the server explorer and dbl click it
- You should now have a "query" toolbar visible . You can recognize it
because it has a "Change type" drop down menu on it. ANyway, there is
a little ison that say "sql" on that toolbar. click it and you're in
SQL view on that table. Feel free to change the SQL and run the
procedure again.

Another (easier) way - use a tool called "SQL Buddy"[1] which mimick a
lot of the features in the Query analyzer, is completly free, and
works against MSDE databases as well.

[1] http://sqlbuddy.sourceforge.net/

---
Regards,

Roy Osherove
www.iserializable.com


I'm running Visual Studio .NET 2002 Pro and have several database
connections that work fine under program control.

But I'd like to manually compose an SQL query while in Server Explorer and
have it executed. This seems like it should be simple, but I just can't seem
to find out how to do it. The "help" describes an "SQL Pane", but really
doesn't say how to get it displayed. I was able to bring up a Query toolbar,
but its always disabled.

My MSDE has been upgraded to SP3.

Seems like I'm missing some little stupid thing, but I just can't
figure
 
It would be nice if Whidbey let you right click on a code pane and select
"insert SQL" to shortcut this technique.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

Srinivas Kanakapally said:
Hi Roy,

It might seem a little awkward because that is one of the obscure ways of
getting to the SQL pane in the query designer. Do the following in the
future for a better experience:

1. In Visual Studio, add a project called 'Database Project' (You can find
this in the 'New Project' dialog located at 'Other Projects --> Database
Projects --> Database Project'
2. Choose an existing data connection (or add a new data connection) for the
database project
3. Once you add the Database Project, you will see that there is a folder
called 'Queries'. Right-click on it and choose 'Add Query'
4. A query designer window opens and you can graphically design the query
(i.e. develop the SQL) that you want. If you are a SQL expert (or if you
already have the SQL text written), then just type (or cut and paste) the
SQL text into the SQL pane.
5. You can then run the query to view the results.

There is another way, you can achieve the functionality (at least some of
the functionality you would see in the Query Analyzer).
1. Once you add the Database Project, you can right-click on any of the
folder and choose 'Add SQL Script'
2. In the Script editor that opens you can type in the SQL text and run the
SQL (or run a part of the SQL).

Let me know if this helps.

Thanks!
Srinivas Kanakapally
Visual Studio .Net Data Tools, MSFT

This posting is provided "AS IS" with no warranties, and confers no rights ..
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.

Don Peters said:
Thanks Roy! You're right, it does work, and it sure seems awkward.

Don


Roy Osherove said:
That's why Qury analyzer exists (but it only comes with SQLServer)
In VS.Net you can do this (but it's pretty akward):
- navigate to any table node in the server explorer and dbl click it
- You should now have a "query" toolbar visible . You can recognize it
because it has a "Change type" drop down menu on it. ANyway, there is
a little ison that say "sql" on that toolbar. click it and you're in
SQL view on that table. Feel free to change the SQL and run the
procedure again.

Another (easier) way - use a tool called "SQL Buddy"[1] which mimick a
lot of the features in the Query analyzer, is completly free, and
works against MSDE databases as well.

[1] http://sqlbuddy.sourceforge.net/

---
Regards,

Roy Osherove
www.iserializable.com


On Wed, 5 Nov 2003 21:54:20 -0500, "Don Peters"

I'm running Visual Studio .NET 2002 Pro and have several database
connections that work fine under program control.

But I'd like to manually compose an SQL query while in Server
Explorer
and
have it executed. This seems like it should be simple, but I just
can't
seem
to find out how to do it. The "help" describes an "SQL Pane", but really
doesn't say how to get it displayed. I was able to bring up a Query toolbar,
but its always disabled.

My MSDE has been upgraded to SP3.

Seems like I'm missing some little stupid thing, but I just can't
figure
out
what it is.

Can anyone help?

Don
 
Hi Roy,

It might seem a little awkward because that is one of the obscure ways of
getting to the SQL pane in the query designer. Do the following in the
future for a better experience:

1. In Visual Studio, add a project called 'Database Project' (You can find
this in the 'New Project' dialog located at 'Other Projects --> Database
Projects --> Database Project'
2. Choose an existing data connection (or add a new data connection) for the
database project
3. Once you add the Database Project, you will see that there is a folder
called 'Queries'. Right-click on it and choose 'Add Query'
4. A query designer window opens and you can graphically design the query
(i.e. develop the SQL) that you want. If you are a SQL expert (or if you
already have the SQL text written), then just type (or cut and paste) the
SQL text into the SQL pane.
5. You can then run the query to view the results.

There is another way, you can achieve the functionality (at least some of
the functionality you would see in the Query Analyzer).
1. Once you add the Database Project, you can right-click on any of the
folder and choose 'Add SQL Script'
2. In the Script editor that opens you can type in the SQL text and run the
SQL (or run a part of the SQL).

Let me know if this helps.

Thanks!
Srinivas Kanakapally
Visual Studio .Net Data Tools, MSFT

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.

Don Peters said:
[40 quoted lines suppressed] really
[7 quoted lines suppressed] figure
[10 quoted lines suppressed]

Thanks Srivinas. That info helps :)
 
Back
Top