Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE PROCEDURE [dbo].[crud_humans_updateField]
- @itemID int,
- @field nvarchar(64),
- @value nvarchar(max),
- @username nvarchar(64)
- AS
- BEGIN
- -- обновление поля таблицы
- -- для приведения типов используйте try_cast(@value as int), Для даты try_convert(date, @value, 104)
- if(@field = 'freelancer') begin
- update hr_humans set freelancer = try_cast(@value as bit) where id = @itemID
- end else if(@field = 'statusID') begin
- update hr_humans set statusID = try_cast(@value as int) where id = @itemID
- end else begin
- select 'Невалидный код свойства' Msg, 0 Result
- return
- end
- select '' Msg, 1 Result
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement