passing values to script using sqlcmd

  • hi

    i have script for database creation which i need to run from a stored procedure by passing dbname and paths

    can one give me the syntax for that

    thanks

    pradeep

  • The same way you would run it via SSMS

    SQLCMD -S server -E "EXEC dbo.CreateDatabase @DBName = 'DatabaseName', @DataPath = 'C:\data\Databasename.mdf', @LogPath = 'C:\log\Databasename.ldf'"

  • Or using the -v option.

    sqlcmd Utility (SQL Server 2005)

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply