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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Stored Procedure Help

Author  Topic 

ExLondoner
Starting Member

1 Post

Posted - 2005-09-20 : 11:53:58
I am trying to create a general test stored procedure that does the following:

Contains two parameters: first and last name

From entering these, I should be able to obtain the person id from the person table and obtain the address.

Hope this makes sense, TIA!

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2005-09-20 : 13:03:11
Hi Tia, your words make sense I just don't know what your question is :)

here is some sample code to create a simple stored procedure. You'll need to provide some DDL for us to help you with the actual sql statement that pulls data from your table(s).

DDL: The scripts necessary to create your sql objects. You can use query analyzer or enterprise manager to generate them.

if object_id('dbo.generalTestSP') > 0
drop proc dbo.generalTestSP
go

create proc dbo.generalTestSP

@lastname varchar(30)
,@firstname varchar(30)

as

select personid
from dbo.people
where lastname = @lastname
and firstname = @firstname

go
grant exec on dbo.generalTestSP to <someAccount>
go


Be One with the Optimizer
TG
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-09-20 : 13:28:48
Homework question alert.

Tara
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-09-20 : 14:06:29
BTW TG... TIA = thanx in advance

Go with the flow & have fun! Else fight the flow
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2005-09-20 : 14:40:05
>>BTW TG... TIA = thanx in advance
Ah! Thank you. So does that mean that Kristen's nickname isn't IMHO ???

btw did you know my last name is IF?

Be One with the Optimizer
TG
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-09-20 : 14:45:12
In My Humble Opinion... no

IF?? i really hope that stands for something...

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -