views:

35

answers:

1

Hi

I am looking through my stored procedures on my server and I got alot of them. The thing is I only made like 10 of the 100 there.

These stored procedures are not system ones(that has its own folder).

They seem to be stored procedures for every table I have.

Example of one

USE [DB]
GO
/****** Object:  StoredProcedure [dbo].[usp_SomeDelete]    Script Date: 06/17/2010 11:58:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROC [dbo].[usp_SomeDelete] 
    @UserId uniqueidentifier
AS 
    SET NOCOUNT ON 
    SET XACT_ABORT ON  

    BEGIN TRAN

    DELETE
    FROM   [dbo].[MyTable]
    WHERE  [UserId] = @UserId

    COMMIT
+4  A: 

Looks like someone used a code generator to develop a business library. Linq to SQL runs dynamic SQL behind the scenes, and although you can utilize stored procedures, it does not create them.

Jordan
not only that but the code generator in question used a bad pattern in prepending 'usp_' to the proc names. yuck.
Chris Lively
Yeah. At least it wasn't sp_ :)
Jordan
Hmm I wonder what made this then. Think I should just delete them and see if my site still works(it should cuz I am referencing any of them).
chobo2
Your site will work if you're exclusively using Linq to SQL. However, unless you're the only person using the database, someone else is probably using them. Most of the time, procedures that look like that are used for admin apps, like basic CRUD and whatnot.
Jordan
Well unless my hosting company is add SP to my stuff then I am the only person who is using the database.
chobo2