Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE PROCEDURE [dbo].[crud_tst-customers_fastCreate]
- @filters CRUDFilterParameter READONLY,
- @text nvarchar(256),
- @username nvarchar(32)
- AS
- BEGIN
- -- создание сущности в таблице по 1 полю @text
- -- извлечение параметров из URL
- --declare @filterItemID int
- --select @filterItemID = try_cast(Value as int) from @filters where [Key] = 'itemID'
- -- проверки
- declare @id int
- select @id = id from tst_customers where name = @text or fio = @text
- if(@id>0) begin
- select 'Такой заказчик уже существует!' Msg, 0 Result
- return
- end
- -- добавление элемента в таблицу
- insert into tst_customers(name, fio)
- values(@text, @text )
- select 'Заказчик создан' Msg, 1 Result
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement