I have this store procedure.Its only half tough and its written in my sql . How do i write this in MSSql Server? How do i signal an error in the right way in Microsoft Sql Server?
DROP PROCEDURE IF EXISTS Artists_By_Genre; DELIMITER $$ CREATE PROCEDURE Artists_By_Genre(MusicGenre varchar(20)) BEGIN DECLARE checkMusicGenre INT; SELECT COUNT(*) INTO checkMusicGenre FROM Music_Types mt WHERE mt.Type = MusicGenre; IF checkMusicGenre = 0 THEN SIGNAL SQLSTATE "22003" SET MESSAGE_TEXT = "Genre does not exists!"; END IF;