Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE PROCEDURE [dbo].[fm_human_getItem]
- @itemID int,
- @username nvarchar(256)
- AS
- BEGIN
- if (@itemID>0) begin
- select fio, depID, phone, freelancer,
- 'Руководитель: '+ isnull((select top 1 fio from hr_humans
- where id in (select managerID from hr_departments where id = h.depID )), '<i>Нет руководителя</i>' ) info
- from hr_humans h
- where h.id = @itemID
- select (select fio from hr_humans h where h.id = @itemID) as Title, '' Subtitle
- from hr_humans h where h.id = @itemID
- end else begin
- select null
- select '' as Title, '' Subtitle
- end
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement