sqlcmd for exporting a huge database with its data

Hi;

I have a database dump which has been dumped in SQL 2012. And when I try to restore it to a SQL2008, it was failing.

I have also SQL2014 licence and I can restore SQL2012 dump in SQL2014. Since my ultimate goal is to have the database in SQL2008, I scripted the database with its content in SQL2014 and save it a script file but this time, I end up with this,

http://blog.daringa.com/archives/tag/error-hresult-e_fail-has-been-returned-from-a-call-to-a-com-component

So, my question is that how can i do this with sqlcmd?

The sqlcmd command must be run under SQL2014 but the authentication is via Windows Authentication. What is the command to export the healthy script in SQL2014?

Br.
LVL 12
jazzIIIloveAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lcohanDatabase AnalystCommented:
Vitor MontalvãoMSSQL Senior EngineerCommented:
And when I try to restore it to a SQL2008, it was failing.
You can't go backwards with the SQL version. MSSQL 2008 just don't recognize MSSQL 2014 databases but the opposite is possible.


I have also SQL2014 licence and I can restore SQL2012 dump in SQL2014.
Yes you can because you are upgrading to a newer version. That's the only direction you can go with backup/restore. Always forward and never backward.


Since my ultimate goal is to have the database in SQL2008, I scripted the database with its content in SQL2014 and save it a script file
No need to go through an hard path. MS SQL Management Studio has a good tool for this and is called Copy Database Wizard. I wrote this article that shows how to transfer a database from a MSSQL instance to another no matter the versions.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.