Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Stored procedures

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-09-22 : 10:20:13
Mike writes "I know this is a basic question, but I am new to all of this...
Where do you write the stored procedure code? The Global.asp file, its own file? Thanks for the help"

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-09-22 : 10:28:53
Stored procedures are database objects "stored" in the database.

CODO ERGO SUM
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2006-09-22 : 12:43:52
Where do you write the stored procedure code?

I do it in Query Analyzer (as sql server client tool) and save the file as a *.sql file on the server itself.

Here's a sproc shell


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_procname]')
and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[usp_procname]
GO

create procedure usp_procname
@objname nvarchar(776)
as
set nocount on

-- SQL Stuff

set nocount off
return (0) -- sp_depends
GO



And if you want a fuller template, read here

http://weblogs.sqlteam.com/brettk/archive/2004/05/25/1378.aspx

TQL, no salt, rocks please


Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam
Go to Top of Page
   

- Advertisement -