Home All Groups Group Topic Archive Search About

saving ad-hoc sqlserver scripts via Visual Studio

Author
4 Jan 2007 8:57 PM
Fred Exley
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

Author
5 Jan 2007 1:42 AM
William (Bill) Vaughn
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)
-----------------------------------------------------------------------------------------------------------------------

Show quote
"Fred Exley" <j**@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
>
Author
5 Jan 2007 5:26 AM
Cor Ligthert [MVP]
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
Author
5 Jan 2007 5:57 AM
RobinS
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.
----------------------------
Show quote
"Cor Ligthert [MVP]" <notmyfirstn***@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
>
Author
5 Jan 2007 6:12 AM
Cor Ligthert [MVP]
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
Author
5 Jan 2007 6:42 AM
RobinS
"Cor Ligthert [MVP]" <notmyfirstn***@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.
Author
5 Jan 2007 6:49 AM
Stephany Young
Don't encourage him!!!!!!


Show quote
"RobinS" <RobinS@NoSpam.yah.none> wrote in message
news:rcydnbez1u_kbgDYnZ2dnUVZ_sapnZ2d@comcast.com...
>
> "Cor Ligthert [MVP]" <notmyfirstn***@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.
>
Author
5 Jan 2007 7:04 PM
RobinS
I can't help but respect people with more knowledge than I,
and the willingness to share it. Like you, bucko.

Robin S.
------------------------------
Show quote
"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]" <notmyfirstn***@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.
>>
>
>
Author
5 Jan 2007 5:53 PM
Fred Exley
"William (Bill) Vaughn" <billvaRemoveT***@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.

AddThis Social Bookmark Button