January 21, 2013 at 11:09 pm
C:\Users\1245>sqlcmd -S MOLNEW0014\TEST -i c:\script.sql
Sqlcmd: 'c:\script.sql': Invalid filename.
January 22, 2013 at 1:20 am
getsimrangujral (1/21/2013)
C:\Users\1245>sqlcmd -S MOLNEW0014\TEST -i c:\script.sqlSqlcmd: 'c:\script.sql': Invalid filename.
Invalid filename, correct the filename and re-try
January 22, 2013 at 5:51 am
it is not working
January 22, 2013 at 5:52 am
What is the error message
January 22, 2013 at 9:58 pm
command line generate script for database ?
January 23, 2013 at 1:28 am
-i is an input file which means you want to use that file to run it against the DB, not that you want to script out the DB to the file.
Do a google search (other search engines avilable) for "Script Database Via Command Line" you will get many hits.
Also remember that SQL has a built in GUI in SSMS which will do this for you.
January 23, 2013 at 1:45 am
Yes i can do with ssms , but the problem is database too large , soo it throw me error
Thank you
January 23, 2013 at 1:47 am
They you need to look at writing a command line program which interfaces with the SQL SMO objects to pull out the DDL of the database.
January 23, 2013 at 1:50 am
look at the end part ( there is a command for large table )
January 23, 2013 at 1:55 am
Yes, but if you read the whole thing, you will see that Pinal Dave has run the SSMS GUI tool, saved the file as c:\script.sql and is then using the command line to run the script to create the objects and import the data.
What are you trying to do?
Have you run the GUI and exported the schema and the data into a file?
January 23, 2013 at 2:05 am
I just want to run this from command line , not by GUI mode ( cz database is too large )
January 23, 2013 at 2:07 am
Do you have a script in the location c:\script.sql which contains the database schema and data to create a new copy of the CZ database?
Or
Do you want to export the CZ database to a file called c:\script.sql which contains all the schemas and data?
January 23, 2013 at 2:10 am
export the database to a file called c:\script.sql which contains all the schemas and data
i want to do this
January 23, 2013 at 2:12 am
Well then you will need to write a command line based application which interfaces with SQL SMO and script out your database to a file.
As detailed, do a search for "Script Database via Command Line" and you will find help on what you want to do.
January 23, 2013 at 2:19 am
i will look into this
Thank you so much for your time
Viewing 15 posts - 1 through 14 (of 14 total)
You must be logged in to reply to this topic. Login to reply