Quantcast
Channel: use parameter in CREATE DATABASE - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Joe Stefanelli for use parameter in CREATE DATABASE

Try using SQLCMD mode. In SSMS, under the Query menu, choose SQLCMD Mode, then run this script.:SETVAR DataFilePath N'C:\ProgramData\Gemcom\TestDB.mdf':SETVAR LogFilePath...

View Article


Answer by Hernan for use parameter in CREATE DATABASE

You will have to use dynamic SQLSELECT @sql = 'CREATE DATABASE TestDB ON PRIMARY ( NAME = ''TestDB_Data'', FILENAME = '+ quotename(@DataFilePath) +') LOG ON ( NAME = ''TestDB_Log'', FILENAME = '+...

View Article


use parameter in CREATE DATABASE

I want to specify the path where data file and log file is created in a SQL script using parameters. Here is what I wrote:DECLARE @DataFilePath AS NVARCHAR(MAX)SET @DataFilePath =...

View Article
Browsing all 3 articles
Browse latest View live


Latest Images