Generate Database script from SQLPubWiz.Create Database from Script through SQLCMD



1.Open Command Prompt.

Execute this Command

"C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\Publishing\1.4\sqlpubwiz.exe" script -C "Data Source=BHAVESH\SQLEXPRESS;Initial Catalog=DBNAME;User Id =sa;Password=bhavesh;" DBNAMEFILENAME.sql


It will generate output.




2.Create Database by executing this query.

--First Create Database.

--Execute this command to create database and schemas.

sqlcmd -S BHAVESH\SQLEXPRESS -E -d DBNAME-i C:\DBNAMEFILENAME.sql


Output something like this...

 


For any help for SQLPUBWIZ or SQLCMD

just execute this commands...

  • sqlpubwiz help
  • sqlpubwiz /? 
  • SQLCMD /?


Comments

Popular posts from this blog

Agent Installation on Windows Server. SQL Server (Failover Cluster) target addition in OEM 12c

Oracle 10g/11g Linux:SMS the alert logs ORA- errors generated in timestamp

Oracle 11g: Install Instant Client 11.2.0.3.0 on Linux x86_64 Server.