Advertisement
hecrus

Drag and drop SQL

Feb 7th, 2021
3,452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.09 KB | None | 0 0
  1. CREATE PROCEDURE [dbo].[falcon_dragDrop]
  2.    @parameters ExtendedDictionaryParameter readonly,
  3.     @username nvarchar(256)
  4. AS
  5. BEGIN
  6.     DECLARE @elementItemID INT, @elementCode nvarchar(128), @containerItemID INT, @containerCode nvarchar(128)
  7.     SELECT @elementItemID = try_cast(Value2 AS INT) FROM @parameters WHERE LOWER([KEY])='elementitemid'
  8.     SELECT @elementCode= Value2 FROM @parameters WHERE LOWER([KEY])='elementcode'
  9.     SELECT @containerItemID = try_cast(Value2 AS INT) FROM @parameters WHERE LOWER([KEY])='containeritemid'
  10.     SELECT @containerCode = Value2 FROM @parameters WHERE LOWER([KEY])='containercode'
  11.  
  12.    
  13.    
  14.     DECLARE @actionType nvarchar(128) = CASE  
  15.         WHEN @elementCode= 'copyType' THEN 'copy'
  16.         WHEN @elementCode= 'moveType' THEN 'move'
  17.         WHEN @elementCode=  'deleteType' THEN 'delete'
  18.         WHEN @elementCode= 'backType' THEN 'back'
  19.     END
  20.    
  21.     EXEC as_print @str=@elementCode
  22.  
  23.     -- SELECT 1
  24.     SELECT 1 RESULT, iif(@elementCode='moveAlert' , 'OK!', '') Msg, 'fa-cogs' icon, 'body' RefreshContainer, @actionType [action] -- move, back, delete, copy
  25.  
  26.     -- SELECT 2 Outer commands
  27.  
  28. END
  29.  
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement