Single stored procedure for insert update and delete and select in sql server

Here, you create a stored procedure with INSERT, SELECT, UPDATE, and DELETE SQL statements. 
 The INSERT statement is 
used to add new rows to a table. The SELECT SQL statement is used to fetch rows from a database table. The UPDATE statement is used to edit and update values of 
an existing record. The DELETE statement is used to delete records (Use with condition) from a database table.
 The following SQL stored procedure is used select insert, update and delete rows from a table, 
depending on the statement type parameter.

CREATE proc [dbo].[ProcName](              
  @Entity_Name varchar(max),              
  @Records_Fields varchar(max),              
  @Records_Values varchar(max),              
  @Action_Type CHAR(2)         
as begin             
  declare @querryString varchar(max)            
       SET @querryString='insert into'+' '+ isnull(@Entity_Name,'') +'('+isnull(@Records_Fields,'') +') values'+'('+isnull(@Records_Values,'')+')'               
  else if(@Action_Type='U')              
       SET @querryString='Update '+ ' '+  isnull(@Entity_Name,'') +' ' +'SET' +' '+ @Records_Fields+ ' '+'where' +' '+@Records_Values                        
 else if(@Action_Type='D')              
       SET @querryString='Delete from '+ ' '+  isnull(@Entity_Name,'') +' '+'where' +' '+@Records_Values               
 else if(@Action_Type='G')              
       IF (@Records_Values='')               
           SET @querryString='Select' +' '+ @Records_Fields+' '+' from '+' ' +@Entity_Name              
           SET @querryString='Select ' +' '+ @Records_Fields+' '+' from '+' ' +@Entity_Name +' '+'where' +' '+@Records_Values               
   else if(@Records_Values='P')
  set @Action_Type='G'
   SET @querryString=@Entity_Name +' '+  @Records_Fields
   print @querryString
exec (@querryString)        

Working fine.....