All pastes #201556 Raw Edit

Stuff

public text v1 · immutable
#201556 ·published 2006-10-13 21:56 UTC
rendered paste body
create procedure sp_insertArtist
(
	@fname varchar(150) = null ,
	@lname varchar(150) = null ,
	@display_name varchar(300) = null ,
	@biography text = null ,
	@is_active bit = null
)
as
set nocount on
begin

	if ( @fname is null and @lname is null and @display_name is null )
	begin
	
		raiserror 50001 'You must specify a name for the artist'
		return
		
	end

	if ( @is_active is null )
		set @is_active = 0
	
	insert into _artist ( fname , lname , display_name , biography , is_active )
		values ( @fname , @lname , @display_name , @biography , @is_active )
	
	return @@identity

end

go