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
 Please help with this stored procedure

Author  Topic 

JasonCamara82
Starting Member

5 Posts

Posted - 2007-01-17 : 12:09:56
I need help ccreating a stored procedure that will delete a customer record from my customers table in my database.
here is what I have so far

use HighSpirits - this is what the database is called
go

create proc usp_deletecustomer
(
@CustomerID int,
@CompanyName varchar(20),
@Address varchar(20),
@City varchar(20),
@Province char(2),
@PostalCode varchar(7),
@PhoneNumber varchar(15)
)
as
select CustomerID, CompanyName, Address, City, Province, PostalCode, PhoneNumber
from CUSTOMERS

if anyone could help me finish this it would be greatly appreciated.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-01-17 : 12:16:50
You don't need all the other paramters only the @CustomerID

create proc usp_deletecustomer
(
@CustomerID int,
@CompanyName varchar(20),
@Address varchar(20),
@City varchar(20),
@Province char(2),
@PostalCode varchar(7),
@PhoneNumber varchar(15)

)
as
select CustomerID, CompanyName, Address, City, Province, PostalCode, PhoneNumber
from CUSTOMERS

delete d
from CUSTOMERS d
where CustomerID = @CustomerID



KH

Go to Top of Page
   

- Advertisement -