Ruslan_Rayanov

Map UpdateField

Oct 18th, 2020
72
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE PROCEDURE [dbo].[crud_testMap_updateField]
  2.     @itemID int,
  3.     @field nvarchar(64),
  4.     @value nvarchar(max),
  5.     @username nvarchar(64)
  6. AS
  7. BEGIN
  8.  
  9. if(@field = 'marker') begin
  10.     declare @lat nvarchar(32), @lng nvarchar(32)
  11.     set @lat = [dbo].[str_splitPart](@value,  '||', 1   )
  12.     set @lng = [dbo].[str_splitPart](@value,  '||', 2   )
  13.  
  14.     update tst_addresses
  15.     set lat = @lat, lng = @lng
  16.     where id = @itemID    
  17. end else begin
  18.     select 'Невалидный код свойства' Msg, 0 Result
  19.     return
  20. end  
  21. select '' Msg, 1 Result
  22.  
  23. END
  24.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×