﻿

-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[fuchs_planner_submit]
	@planner tinyint
	,@session varchar(10)
	,@group_code varchar(10)
	,@values varchar(4000)
AS
BEGIN
	SET NOCOUNT ON;

	SET @session = ISNULL(@session, (SELECT TOP(1) [s] FROM [dbo].[ott_20_randomstrings](5) as rs WHERE NOT EXISTS (SELECT * FROM [fuchs_planner_traffic] as t WHERE t.[sessionid] = rs.[s])));
	INSERT INTO [dbo].[fuchs_planner_traffic] ([planner_id], [sessionid],[group_code],[values]) VALUES(@planner, @session, @group_code, ISNULL(@values, ''));


END