Showing posts with label old. Show all posts
Showing posts with label old. Show all posts

Tuesday, March 27, 2012

Exporting Logins

I need to move a database to a new SQL Server. I would like to make it easie
r
to move the Logins from the old server to the new server so that a
backup/restore will allow the database to get up and running with minimal
effort.
Since you can script just about anything, I was looking for a way to script
the Logins to facilitate their movement? Is there such a process? Is there a
different or better way to move the Logins to another SQL Server (2005)?
--
Michael HocksteinHi Michael..
You can take a look in the post " how to transfer logins between 2k5
instances" a few threads ago. Also you can check
http://support.microsoft.com/defaul...kb;en-us;246133
Regards
Antonio Soto
Solid Quality Learning
"michael" <howlinghound@.nospam.nospam> escribi en el mensaje
news:4E518423-6E53-4D30-B059-D8BC1FD23E3D@.microsoft.com...
>I need to move a database to a new SQL Server. I would like to make it
>easier
> to move the Logins from the old server to the new server so that a
> backup/restore will allow the database to get up and running with minimal
> effort.
> Since you can script just about anything, I was looking for a way to
> script
> the Logins to facilitate their movement? Is there such a process? Is there
> a
> different or better way to move the Logins to another SQL Server (2005)?
> --
> Michael Hockstein|||Thanks. Sorry I missed a post that was literally under my nose.
Michael Hockstein
"Antonio Soto" wrote:

> Hi Michael..
> You can take a look in the post " how to transfer logins between 2k5
> instances" a few threads ago. Also you can check
> http://support.microsoft.com/defaul...kb;en-us;246133
> Regards
> Antonio Soto
> Solid Quality Learning
>
> "michael" <howlinghound@.nospam.nospam> escribió en el mensaje
> news:4E518423-6E53-4D30-B059-D8BC1FD23E3D@.microsoft.com...
>
>sql

Sunday, March 25, 2012

Exporting data with SMO?

I have searched low and high for some information on how to export data with SMO. My old build scripts were using SQLDMO.BulkCopy which was using BCP and it worked fast on entire database.
I can't find a way to do the same with SMO. As alternative, I tried using bcp.exe on each table but it's awefully slow because initial process startup overhead.
Please don't recommend Transfer class as I'm not looking to transfer server-to-server but server-to-hdd. Backup isn't right as well.
Any suggestions?
Thank you.
Alex

I'm not certain but I think the functionality you're looking for is now in the SSIS (SQL Server Integration Services) toolkit. It's the next evolution of DTS (which the BCP util uses by generating an adhoc DTS package). Or you can use the DMO with 2005 (you have to install the backwards compatibility components when installing SQL 2005 or you can add it on later if you want).

Note that SSIS is not available for SQL Server 2005 Express so you have to use DMO to do what you want (or BCP) if you don't have Standard or above. Also, you will find that the tools for designing SSIS packages are much more friendly than hand coding DMO.

|||

With regard to copying data: there is a Transfer object that perform this in an 'online' type of fashion. It creates the target database, creates the schema, and copies the data. All steps are optional.

See this sample for a starting point: http://blogs.msdn.com/mwories/articles/smosample_transfer.aspx

BTW, we decided not to implement BulkCopy in SMO as we lacked the proper library support for it. It ended up being a shim around SQL-DMO if we would have gone along with it. That would have not been much of an improvement.

SSIS is indeed something to look at.

Another option is to use the old DMO BulkCopy ad interim, until System.Data has full BulkCopy support (see the current bulkcopy object; which does not perform all of the functionality that the old BulkCopy object did).