Showing posts with label version. Show all posts
Showing posts with label version. Show all posts

Sunday, March 25, 2012

Copying variables from another package

HI, we have something like 120 packages that need to be "upgraded" to a newer version of a template. Basically, we need to add a bunch of variables of various types (12-15 variables). Is there a way to open the package in a script task and add those variables programmatically? Or is there another way to do it (e.g. modify the dtsx file)?

Thank you,

Ccote

There's no way to do this using the Designer. However a package is just an XML document so you try adding a new variable by processing those XML documents using XQuery.

If you work out how to do that - reply here and let me know

-Jamie

|||

HI Jamie, I have been able to achieve something interesting by using a script component with the test code below:

Public Sub Main()
Dim application As Microsoft.SqlServer.Dts.Runtime.Application = New Application()
Dim packagename As Object = Dts.Connections("ChildPackage").AcquireConnection(Nothing)
Dim package As Microsoft.SqlServer.Dts.Runtime.Package = application.LoadPackage(packagename.ToString(), Nothing)
If Not package.Variables.Contains("VarTestNum") Then
package.Variables.Add("VarTestNum", False, "User", 0)
application.SaveToXml(packagename.ToString, package, Nothing)
End If

Dts.TaskResult = Dts.Results.Success

End Sub

The basis of the code I am using comes from Brian Knight web site.So far, I am not able to specify the type of the variable; It seems that SSIS resolve it using the Value method parameter (last one). I do not know if it will bw able to parse a date value correctly. But at least, if all I have to do is to change a type of a couple of variables in all package, the worst is done.

Ccote

|||

You're right about the variable type It is determined by the type of the object that you pass in that parameter.

-Jamie

Tuesday, March 20, 2012

Copying my existing database to another server

Hi

I am running my sql 2000 database server and I just want to copy that database and paste or put on another server which has also run same version of sql 2000 database. I tried to copy and paste the ldf & mdf extensioned files which are located in "C:\Program Files\Microsoft SQL Server\MSSQL\Data" into my 2 server, but when I open up the enterprise manager, I cant see the new database. So this way dont work, I tried to do something with export and import wizard but it just creates another database and copies the data in that database in the same server. I want to copy that data and put onto another system, please guide me. I'm confused, Thanks a lot

Use the copy database wizard-http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_onmigwiz_0z50.asp|||

That's it,

Thanks thanks thanks :)

|||One thing to keep in mind: Copy Database Wizard is only available in SQL2005, and the destination data source must be SQL2005. For SQL2000 you can use Backup/Restore to move databases. You may take a look at:Copying Databases to Other Servers|||Actually, it's available in SQL Server 2000 as well, see the link in my first post.|||Thanks Mudface, you teach me a lotSmilesql

Friday, February 24, 2012

Copy to CD

Hi there,
Is there anyway to export an exact version of a database to CD so i can then go to another site and import the image of the database onto their server. Ive tried but cant find the best file format and also i keep getting problems such as auto increments d
ont get carried across in the table design. Hope someone can help me out.
JP
James,
if you mean from the point of view of replication, have a look at
"subscription databases, copying" in BOL. If this is a general query then
it's just backup and restore.
Regards,
Paul Ibison
|||is you are doing a subscription copy make sure your db is under 2Gb.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:ez1re6lGEHA.1228@.TK2MSFTNGP11.phx.gbl...
> James,
> if you mean from the point of view of replication, have a look at
> "subscription databases, copying" in BOL. If this is a general query then
> it's just backup and restore.
> Regards,
> Paul Ibison
>

Sunday, February 19, 2012

Copy tables between servers using SQL Server 2005 Enterprise Edition

Hi,

I am trying to use SQL Server 2005 Enterprise Edition to copy tables from my local server to my hosts server at brinkster.com. In the old version you could use DTS, but everything seems to have got far more complicated now!

Please can anybody guide me in the right direction?

Thanks a lot.

Now you can use SSIS package instead of DTS package, which can also be generated by using Import/Export Wizard as DTSSmile Yes it is more complex than DTS, but much more powerful, you can start from here:

http://msdn2.microsoft.com/en-us/library/ms141134(d=ide).aspx

When you talking about copying table between servers, do you mean to copy data as well or just copy table schema? If you only want to copy table schema, you can easily do this by generating scripts for the tables on the source server: simply right click a database->choose Tasks->Generate Scripts.

If you want to copy data as well, Import/Export Wizard is your good friend; or you can backup the databases on the source server then restore from the backups on the destination; or you can even use Copy Database Wizard.

|||

Thanks a lot lori_Jay, it's much easier when you know what you're looking for! It turned out I hadn't installed all the necessary components. Best to always do a full install if you have the space I guess.

Thanks again.

Monday, February 13, 2012

Copy SQL Server 6.5 Database

I am trying to copying a version 6.5 database on one serv to another version
6. database on another server. And finally upgrade the 6.5 database to 2000.
As I have never worked with 6.5, how do I perform the copy? We have to
perform this step as the current server is dying.
Otto
Hi
You need to do a backup (DUMP) on the old server, copy the file over and
then a restore (LOAD) on the new 6.5 server.
You can do the dump and restore through Enterprise Manager. SQL 6.5 does not
support attach/detach.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Otto@.ITP" <OttoITP@.discussions.microsoft.com> wrote in message
news:1AA7D978-FACD-4F5F-BE42-A59CBD6D682B@.microsoft.com...
> I am trying to copying a version 6.5 database on one serv to another
version
> 6. database on another server. And finally upgrade the 6.5 database to
2000.
> As I have never worked with 6.5, how do I perform the copy? We have to
> perform this step as the current server is dying.
> Otto
|||Otto,
You will need to run sp_help_revdatabase first on the existing server. This
will give you the order of allocations that were used to create the
database.
Use that information to create the exact same database structure on another
6.5 server. Then do a DATABASE DUMP from the original server and a DATABASE
RESTORE to the target server.
When doing this, remember that the sysusers table points to entries in
syslogins. The chances are very small that your users will map properly.
(I would recommend recording the rights granted to each user using
sp_helprotect, deleting the users, then recreating them with the appropriate
rights on the SS2000 server once you are done.)
RLF
"Otto@.ITP" <OttoITP@.discussions.microsoft.com> wrote in message
news:1AA7D978-FACD-4F5F-BE42-A59CBD6D682B@.microsoft.com...
> I am trying to copying a version 6.5 database on one serv to another
version
> 6. database on another server. And finally upgrade the 6.5 database to
2000.
> As I have never worked with 6.5, how do I perform the copy? We have to
> perform this step as the current server is dying.
> Otto

Copy SQL Server 6.5 Database

I am trying to copying a version 6.5 database on one serv to another version
6. database on another server. And finally upgrade the 6.5 database to 2000.
As I have never worked with 6.5, how do I perform the copy? We have to
perform this step as the current server is dying.
OttoHi
You need to do a backup (DUMP) on the old server, copy the file over and
then a restore (LOAD) on the new 6.5 server.
You can do the dump and restore through Enterprise Manager. SQL 6.5 does not
support attach/detach.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Otto@.ITP" <OttoITP@.discussions.microsoft.com> wrote in message
news:1AA7D978-FACD-4F5F-BE42-A59CBD6D682B@.microsoft.com...
> I am trying to copying a version 6.5 database on one serv to another
version
> 6. database on another server. And finally upgrade the 6.5 database to
2000.
> As I have never worked with 6.5, how do I perform the copy? We have to
> perform this step as the current server is dying.
> Otto|||Otto,
You will need to run sp_help_revdatabase first on the existing server. This
will give you the order of allocations that were used to create the
database.
Use that information to create the exact same database structure on another
6.5 server. Then do a DATABASE DUMP from the original server and a DATABASE
RESTORE to the target server.
When doing this, remember that the sysusers table points to entries in
syslogins. The chances are very small that your users will map properly.
(I would recommend recording the rights granted to each user using
sp_helprotect, deleting the users, then recreating them with the appropriate
rights on the SS2000 server once you are done.)
RLF
"Otto@.ITP" <OttoITP@.discussions.microsoft.com> wrote in message
news:1AA7D978-FACD-4F5F-BE42-A59CBD6D682B@.microsoft.com...
> I am trying to copying a version 6.5 database on one serv to another
version
> 6. database on another server. And finally upgrade the 6.5 database to
2000.
> As I have never worked with 6.5, how do I perform the copy? We have to
> perform this step as the current server is dying.
> Otto