[quoted text, click to view] > I never thought to
> Execute it because the SP relies on parameters to execute, so without some
> test data I just figured Execute would fail and do nothing else. It did
> not
> seem obvious to me though that the Execute command would add the SP to the
> database.
Okay, I can understand how you would think that. It's important to
understand that when you use the Execute button, only the statement or
statements in the query window are executed. In your case, the T-SQL
statement CREATE PROCEDURE is executed, but the statements could also have
been INSERT, DELETE, ALTER PROCEDURE, or any other T-SQL statement.
--
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
[quoted text, click to view] "BLiTZWiNG" <BLiTZWiNG@discussions.microsoft.com> wrote in message
news:AFF3E778-449C-4D24-9DD5-2D7E3B70D5B9@microsoft.com...
> Thanks for that. I'm using the Managment Studio CTP (not sure if there is
> a
> release version of it). Anyway, Execute worked for me. I never thought to
> Execute it because the SP relies on parameters to execute, so without some
> test data I just figured Execute would fail and do nothing else. It did
> not
> seem obvious to me though that the Execute command would add the SP to the
> database.
>
> "Gail Erickson [MS]" wrote:
>
>> Stored procedures are created by executing the statement(s) in the
>> SQLQuery1.sql file. You don't mention what interface you're using (e.g.
>> Visual Studio, SQL Server Management Studio, etc.), but you should have
>> an
>> EXECUTE button somewhere on the toolbar. With the file open, click
>> EXECUTE.
>> Assuming no errors were encountered the stored procedure is created in
>> the
>> database. You can keep the file that contains the CREATE PROC statement
>> or
>> not depending on your needs.
>>
>> --
>> Gail Erickson [MS]
>> SQL Server Documentation Team
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights
>>
>> "BLiTZWiNG" <BLiTZWiNG@discussions.microsoft.com> wrote in message
>> news:273B5E46-FCBE-4D90-A5C6-7A37ADDC1CE9@microsoft.com...
>> >I select New Stored Procedure from the context menu of the stored
>> >procedure
>> > tab in my database, and it procedes to makes a file called
>> > SQLQuery1.sql
>> > and
>> > saves it as a file, but doesn't add it to the list of my stored
>> > procedures...
>> >
>> > How do I add it? What am I doing wrong? I see no method of importing
>> > the
>> > sql
>> > file into my database...
>> >
>> > Any help appreciated
>>
>>
>>