Answer the question
In order to leave comments, you need to log in
How to delete a specific entry or group in one request?
Table of options for naming various objects.
CREATE TABLE [dbo].[Variation](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Kind] [char](1) NOT NULL,
[Object] [int] NOT NULL,
[Value] [varchar](500) NOT NULL,
[Key] AS ([Kind]+CONVERT([varchar],[object]))
)
Answer the question
In order to leave comments, you need to log in
CREATE PROCEDURE VariationDelete @KEY VARCHAR(10), @ID INT = -1
AS
DELETE FROM [Variation]
WHERE ([Key] = @KEY) AND ((@ID = -1 ) OR (ID = @ID ))
--
GO
@ID
, all entries are deleted by @KEY
, when specified, only one entry.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question