Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions sql/sp_Insert_User.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
create or alter procedure sp_Insert_User
(
--user attributes
@full_name varchar(100),
@email varchar(200),
@oid varchar(100)
)
WITH EXECUTE AS 'dbo'
AS
BEGIN
declare @dummy_company_id int;

--selects the id of the company record associated with 'initial_import_company'
set @dummy_company_id = (select id from [dbo].[company] c where c.name like 'initial_import_company')

--Creates new company record
INSERT INTO [dbo].[user]([company_id],[oid],[email],[full_name],[is_active],[is_superuser])
VALUES (@dummy_company_id, @oid, @email, @full_name,1,0);
END