title: How can I use parameter in a SQL script file
body: <p>I want to create a database with a SQL script file but I cannot give a parameter instead of database name how can I solve this?</p>
  
  <pre><code>Declare @Test as nvarchar(max)
  
  CREATE DATABASE [@Test] ON  PRIMARY 
    ( NAME = N'@Test', 
      FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\@Test.mdf', 
      SIZE = 11264KB , MAXSIZE = 51200KB , FILEGROWTH = 10%)
   LOG ON 
   ( NAME = N'@Test_log', 
     FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\@Test_1.ldf' , 
     SIZE = 9216KB , MAXSIZE = 25600KB , FILEGROWTH = 1024KB )
  GO
  
  ALTER DATABASE [@Test] SET COMPATIBILITY_LEVEL = 100
  GO
  </code></pre>