ProgrammingMSAccess.com

Learn about Developers Group
Join Developers Group
Order SPAM Blocker
Free Stuff
Guest Book
.NET Resources
SQL Server Resources
Favorites
Technical Support
Books & DVDs by Webmaster
Articles, tutorials, & more
FAQs
Product Reviews
Samples
Prior Newsletters
Contact Us
Home
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A Transact-sql script to create a stored procedure that deletes any row from the shippers table by its shipperID value.  this t-sql script starts by dropping the stored proc if it existed previously, then it creates the new stored procedure.

 

--Delete a row by its ShipperID value
IF EXISTS (SELECT ROUTINE_NAME
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE = 'PROCEDURE' AND
ROUTINE_NAME = 'uspDeleteShipperID')
DROP PROCEDURE uspDeleteShipperID
GO

CREATE PROC uspDeleteShipperID
@ShipperID int
AS
DELETE
FROM Northwind.dbo.Shippers
WHERE ShipperID = @ShipperID
GO

 

Want to understand  SQL Server so that you can program it to do more tasks like this?  Get Programming Microsoft SQL Server 2000 with Microsoft Visual Basic .NET by Rick Dobson from Microsoft Press.  Learn more about the book by clicking here.

Copyright 2004 CAB, Inc. All rights reserved. Republication or redistribution of CAB, Inc. content, including by framing or similar means, is expressly prohibited without the prior written consent of CAB, Inc. CAB, Inc. shall not be liable for any errors in the content, or for any actions taken in reliance thereon.