Ще трябва да използвате динамичен SQL
SELECT @sql = 'CREATE DATABASE TestDB ON PRIMARY ( NAME = ''TestDB_Data'',
FILENAME = ' + quotename(@DataFilePath) + ') LOG ON ( NAME = ''TestDB_Log'',
FILENAME = ' + quotename(@LogFilePath) + ')'
EXEC (@sql)