title: Create table in sql server with input parameters
body: <p>I want to create a table in SQL server via stored procedure.</p>
  
  <p>Here's an example of what I'd like to do:</p>
  
  <pre><code>create procedure test @Title nvarchar(50), @number int @chapter int
  as
  begin
    declare @nam nvrachar(50)
    set nam=@Title
    if exists(select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME=@Title)
    begin
      update @Title set number=@number
      where chapter=@chapter
    end
    else
    begin
      create table @Title ( number int null, chapter int null );
      insert into @Title values ( @number, @chapter )
    end
  end
  </code></pre>
  
  <p>Where the Title is a user selected book from the application, which is passed to SQL Server.</p>