PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET saving ad-hoc sqlserver scripts via Visual Studio

Reply

saving ad-hoc sqlserver scripts via Visual Studio

 
Thread Tools Rate Thread
Old 04-01-2007, 08:57 PM   #1
Fred Exley
Guest
 
Posts: n/a
Default saving ad-hoc sqlserver scripts via Visual Studio


I come from an Oracle background, where one can, in addition to having
stored procedures in the db, load and run text files containing sql DDL or
DML commands. But I can't seem to find an equivalent in VS2005. I can
create and run an ad-hoc query in the SQL Pane, provided I have already
opened a particular table, but then I don't see how to save that ad-hoc
query as an external script for later use. Is there a way to do this,
rather than making a formal stored procedure? thanks


  Reply With Quote
Old 05-01-2007, 01:42 AM   #2
William \(Bill\) Vaughn
Guest
 
Posts: n/a
Default Re: saving ad-hoc sqlserver scripts via Visual Studio

Yes, by creating a database project. It has the ability to help you create
and store SQL scripts.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
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.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

"Fred Exley" <jqr@dslextreme.com> wrote in message
news:12pqqgta97n7798@corp.supernews.com...
>I come from an Oracle background, where one can, in addition to having
>stored procedures in the db, load and run text files containing sql DDL or
>DML commands. But I can't seem to find an equivalent in VS2005. I can
>create and run an ad-hoc query in the SQL Pane, provided I have already
>opened a particular table, but then I don't see how to save that ad-hoc
>query as an external script for later use. Is there a way to do this,
>rather than making a formal stored procedure? thanks
>



  Reply With Quote
Old 05-01-2007, 05:26 AM   #3
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: saving ad-hoc sqlserver scripts via Visual Studio

Bill,

I have not used it (I know it but only have looked slightly to it, it really
seems nice to me for documentation but than I have to start a new (hug)
project), but the question was Run as well. Is that possible from that
database project?

serious question.

Cor


  Reply With Quote
Old 05-01-2007, 05:57 AM   #4
RobinS
Guest
 
Posts: n/a
Default Re: saving ad-hoc sqlserver scripts via Visual Studio

Yes, it is. At least, it's possible to run the script to update the
stored procedure. I think you can test the stored procedure using
the Server Explorer in VS2005.

Robin S.
----------------------------
"Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
news:eFVLHnIMHHA.780@TK2MSFTNGP03.phx.gbl...
> Bill,
>
> I have not used it (I know it but only have looked slightly to it, it
> really seems nice to me for documentation but than I have to start a
> new (hug) project), but the question was Run as well. Is that possible
> from that database project?
>
> serious question.
>
> Cor
>



  Reply With Quote
Old 05-01-2007, 06:12 AM   #5
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: saving ad-hoc sqlserver scripts via Visual Studio

Robin,

> stored procedure. I think you can test the stored procedure using
> the Server Explorer in VS2005.
>

You had the idea that I did not know that?

:-)

Cor


  Reply With Quote
Old 05-01-2007, 06:42 AM   #6
RobinS
Guest
 
Posts: n/a
Default Re: saving ad-hoc sqlserver scripts via Visual Studio


"Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
news:%230KiaAJMHHA.4848@TK2MSFTNGP04.phx.gbl...
> Robin,
>
>> stored procedure. I think you can test the stored procedure using
>> the Server Explorer in VS2005.
>>

> You had the idea that I did not know that?
>
> :-)
>
> Cor


Sorry, I thought you were asking about the Database Project stuff,
but wasn't completely sure, so I threw in a little extra. Frankly,
I think you know everything, and just post questions like this
to test the rest of us. ;-)

Robin S.


  Reply With Quote
Old 05-01-2007, 06:49 AM   #7
Stephany Young
Guest
 
Posts: n/a
Default Re: saving ad-hoc sqlserver scripts via Visual Studio

Don't encourage him!!!!!!


"RobinS" <RobinS@NoSpam.yah.none> wrote in message
news:rcydnbez1u_kbgDYnZ2dnUVZ_sapnZ2d@comcast.com...
>
> "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
> news:%230KiaAJMHHA.4848@TK2MSFTNGP04.phx.gbl...
>> Robin,
>>
>>> stored procedure. I think you can test the stored procedure using
>>> the Server Explorer in VS2005.
>>>

>> You had the idea that I did not know that?
>>
>> :-)
>>
>> Cor

>
> Sorry, I thought you were asking about the Database Project stuff,
> but wasn't completely sure, so I threw in a little extra. Frankly,
> I think you know everything, and just post questions like this
> to test the rest of us. ;-)
>
> Robin S.
>



  Reply With Quote
Old 05-01-2007, 05:53 PM   #8
Fred Exley
Guest
 
Posts: n/a
Default Re: saving ad-hoc sqlserver scripts via Visual Studio


"William (Bill) Vaughn" <billvaRemoveThis@nwlink.com> wrote in message
news:OsZ91qGMHHA.420@TK2MSFTNGP06.phx.gbl...
> Yes, by creating a database project. It has the ability to help you create
> and store SQL scripts.


OK thanks, I'll look into it.


  Reply With Quote
Old 05-01-2007, 07:04 PM   #9
RobinS
Guest
 
Posts: n/a
Default Re: saving ad-hoc sqlserver scripts via Visual Studio

I can't help but respect people with more knowledge than I,
and the willingness to share it. Like you, bucko.

Robin S.
------------------------------
"Stephany Young" <noone@localhost> wrote in message
news:er8EaWJMHHA.3312@TK2MSFTNGP03.phx.gbl...
> Don't encourage him!!!!!!
>
>
> "RobinS" <RobinS@NoSpam.yah.none> wrote in message
> news:rcydnbez1u_kbgDYnZ2dnUVZ_sapnZ2d@comcast.com...
>>
>> "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
>> news:%230KiaAJMHHA.4848@TK2MSFTNGP04.phx.gbl...
>>> Robin,
>>>
>>>> stored procedure. I think you can test the stored procedure using
>>>> the Server Explorer in VS2005.
>>>>
>>> You had the idea that I did not know that?
>>>
>>> :-)
>>>
>>> Cor

>>
>> Sorry, I thought you were asking about the Database Project stuff,
>> but wasn't completely sure, so I threw in a little extra. Frankly,
>> I think you know everything, and just post questions like this
>> to test the rest of us. ;-)
>>
>> Robin S.
>>

>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off