Visa ett inlägg
Oläst 2012-10-05, 01:36 #9
Conny Westh Conny Westh är inte uppkopplad
Klarade millennium-buggen
 
Reg.datum: Aug 2005
Inlägg: 5 166
Conny Westh Conny Westh är inte uppkopplad
Klarade millennium-buggen
 
Reg.datum: Aug 2005
Inlägg: 5 166
Här kommer lite stored procedures som kan vara till hjälp:

Kod:
CREATE PROCEDURE [dbo].[LevelInsert]
	@Level int,
	@LowValue int,
	@HighValue int
AS
BEGIN
	INSERT INTO [dbo].[LevelDefinition] ([Level],[LowValue],[HighValue])
	SELECT @Level,@LowValue,@HighValue
END
GO

CREATE PROCEDURE [dbo].[LevelUpdate]
	@Level int,
	@LowValue int,
	@HighValue int
AS
BEGIN
	UPDATE [dbo].[LevelDefinition] 
	SET 
	[LowValue]=@LowValue,
	[HighValue]=@HighValue
	WHERE [Level]=@Level
END
GO

CREATE PROCEDURE [dbo].[LevelDelete]
	@Level int
AS
BEGIN
	DELETE [dbo].[LevelDefinition]
	WHERE [Level]=@Level
END
GO

CREATE PROCEDURE [dbo].[LevelInit]
AS
BEGIN
	EXEC [dbo].[LevelInsert] 1000,1000,999999;
	EXEC [dbo].[LevelInsert] 500,500,999;
	EXEC [dbo].[LevelInsert] 200,200,499;
	EXEC [dbo].[LevelInsert] 100,100,199;
	EXEC [dbo].[LevelInsert] 50,50,99;
	EXEC [dbo].[LevelInsert] 10,10,49;
	EXEC [dbo].[LevelInsert] 0,0,9;
END
GO
Conny Westh är inte uppkopplad   Svara med citatSvara med citat