cbeverly
asked on
SQL datbase export
I am trying to export a SQL database which I generally do in SQL Server Management Studio (2008) using Generate Scripts. This works fine for exporting the entire database and data, however, I'd like to just export only select fields. I tried creating a view and exporting only the view but I never saw any of the data (even after selecting "Schema and Data" in types of data to script under Advanced.
Is there a way to export data and schema using a Select query for only certain fields and data you'd like exported?
Thanks!
Is there a way to export data and schema using a Select query for only certain fields and data you'd like exported?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Another option would be to use 'bcp' with a query. That'll export a table out as well, and you can specify how you want it formatted:
http://msdn.microsoft.com/en-us/library/ms191485.aspx
Not sure what you're then trying to import this into. If its another SQL server, you can use BCP's internal binary format.
http://msdn.microsoft.com/en-us/library/ms191485.aspx
Not sure what you're then trying to import this into. If its another SQL server, you can use BCP's internal binary format.
My suggestion - create a new table containing the data structure you want and export that (then delete it):
Open in new window