Showing posts with label package. Show all posts
Showing posts with label package. Show all posts

Monday, March 26, 2012

How to determine package's executing folder?

I should have written this down when I came across it -- but I recently saw an example of how to determine a package's currently-executing folder. Can anyone help?

Thanks!

- Mike

Can you elaborate on what you mean by "the current executing folder"?

-Jamie

|||

Jamie Thomson wrote:

Can you elaborate on what you mean by "the current executing folder"?

-Jamie

Thanks, Jamie -- sure, the folder where the DTSX resides as it executes.

Here's the situation -- the DBAs want to put all the packages I've prepared into a single folder.

The "main" package calls each of 42 "sub-packages", one after another. I'm planning to use the
Execute Package task for each of the 42, and set it to "File system" to reference each of the 42.

The Connection property of the Execute Package task wants the path to the DTSX file the Execute Package
task runs, and I'm not sure how to set this at runtime. Because all the packages will live in the same arbitrary
folder, I hoped I might be able to use an expression or something to set the Connection property properly.

Thanks for asking!

- Mike

|||

mike.groh wrote:

Jamie Thomson wrote:

Can you elaborate on what you mean by "the current executing folder"?

-Jamie

Thanks, Jamie -- sure, the folder where the DTSX resides as it executes.

Here's the situation -- the DBAs want to put all the packages I've prepared into a single folder.

The "main" package calls each of 42 "sub-packages", one after another. I'm planning to use the
Execute Package task for each of the 42, and set it to "File system" to reference each of the 42.

The Connection property of the Execute Package task wants the path to the DTSX file the Execute Package
task runs, and I'm not sure how to set this at runtime. Because all the packages will live in the same arbitrary
folder, I hoped I might be able to use an expression or something to set the Connection property properly.

Thanks for asking!

- Mike

Right. Well as far as I know theres no way for the package to discover where it "lives". The way I solve this is for each package to have a variable called RootFolder which gets set by an indirect configuration. I've talked about it on my blog quite a bit:

Common folder structure
(http://blogs.conchango.com/jamiethomson/archive/2006/01/05/2559.aspx)

Indirect configurations ROCK!
(http://blogs.conchango.com/jamiethomson/archive/2005/11/02/2342.aspx)

Indirect configurations gotcha
http://blogs.conchango.com/jamiethomson/archive/2005/10/31/2336.aspx

-Jamie

|||

Thanks! I'll check it out in your blog.

- Mike

How to determine OnPostExecute instance

I have a package that sends an email using the OnPostExecute Event Handler. My understanding is that the event is fired once for the package and once for any containers in the package.

I only want to send the email once. Currently I use a variable to count the number of times OnPostExecute is called and only send the email if it is the first time. This is probably not a good long term solution. How can I determine when OnPostExecute is being fired by the package instead of by a container?

Thanks in advance.

Check the SourceName variable. Put a dummy script task in the event handler and put a precedence contraint from the script task to the Send Mail task with the expression "SourceName == PackageName".
|||Which just goes to show that I'd like to see container specific events -- meaning child events don't propagate up.|||

Thanks, Jay. Your recommendation solved the problem.

Code Snippet

If (Dts.Variables("PackageName").Value.ToString = Dts.Variables("SourceName").Value.ToString) Then

'Do something

End If

Phil, I agree. That would be nice.

|||Okay, I just want to make sure I was clear that I wasn't recommending that any code go into the Script Task. As I described it, the Script Task is simply there to allow you to set a precedence between the Script Task and the Send Mail Task. You can then put an expression on the contraint (@.PackageName == @.SourceName) and require that the expression evaluate to true for the dependent task to execute. Then your mail would only be sent if the SourceName of the event was the same as the PackageName. Right-click on the green line and click Edit to see these options.

Friday, March 23, 2012

How to determine if SQL 7 SP4 or higher is installed using Registry

I am developing an .msi package that requires SQL 7 SP4 or higher to be installed. I would like to use the registry to confirm a valid SQL installation and from there I can determine if my .msi installation should continue as normal or display an error m
essage asking to install SQL first.
I couldn't find much solid information on the web. This is all I have:
All versions:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\MSSQLServer
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer
6.0 and above:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Servic es\MSDTC
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\SQLExecutive
7.0 and above:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\SQLServerAgent
HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server 7
HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServ65
However, what key and value should I use to look for the specific SQL version? Does this value hold a simple number like '7' and for any more recent versions of SQL would this number be higher in value? Such as '2000' for a SQL 2000 unit?
Thanks for your time
HKEY_LOCAL_MACHINE/Software/Microsoft/MSSQLServer/MSSQLServer/CurrentVersion
/CSDVersion
Rohtash Kapoor
http://www.sqlmantra.com
"k8e" <anonymous@.discussions.microsoft.com> wrote in message
news:0E857F02-C889-4951-BC38-1ADFB361B9EA@.microsoft.com...
> I am developing an .msi package that requires SQL 7 SP4 or higher to be
installed. I would like to use the registry to confirm a valid SQL
installation and from there I can determine if my .msi installation should
continue as normal or display an error message asking to install SQL first.
> --
> I couldn't find much solid information on the web. This is all I have:
> All versions:
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\MSSQLServer
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer
> 6.0 and above:
> HKEY_LOCAL_MACHINE\System\CurrentControlSet\Servic es\MSDTC
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\SQLExecutive
> 7.0 and above:
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\SQLServerAgent
> HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server 7
> HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServ65
> --
> However, what key and value should I use to look for the specific SQL
version? Does this value hold a simple number like '7' and for any more
recent versions of SQL would this number be higher in value? Such as '2000'
for a SQL 2000 unit?
> Thanks for your time

Monday, March 12, 2012

How to Deploy SQL server Database to another PC while creating SetUP package in .Net VB

How to Deploy SQL server Database to another PC, How to create a
package that craetes Database as well as ODBC driver for accessing data
at enduser PC, using .Net VBhi,
<hitendra15@.gmail.com> ha scritto nel messaggio
news:1102241845.011857.112670@.c13g2000cwb.googlegr oups.com
> How to Deploy SQL server Database to another PC, How to create a
> package that craetes Database as well as ODBC driver for accessing
> data at enduser PC, using .Net VB

John already answered you about drivers...
as regard database installation, personally I do not like backup/restore
practice, nor detach/attach...
and Ialways go for executing the DDL scripts to recreate the dbs and related
objects as long as performing BCP in and/or INSERT INTO scripts in order to
populate pre-loaded tables...
the best "universal" approach I've seen so far explained in a public article
is
http://msdn.microsoft.com/sql/archi...er/default.aspx
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtm http://italy.mvps.org
DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
--- remove DMO to reply|||To add on to Andrea's response, we keep all of our DDL scripts under source
control and run these scripts during installation with a .Net custom action.

Depending on your requirements, you can include the scripts in a .Net
project as either content files or as embedded resources. You can then
include that project in your Setup and Deployment project. Your custom
action can read and execute the scripts from either the resource assembly or
from the file system.

--
Hope this helps.

Dan Guzman
SQL Server MVP

<hitendra15@.gmail.com> wrote in message
news:1102241845.011857.112670@.c13g2000cwb.googlegr oups.com...
> How to Deploy SQL server Database to another PC, How to create a
> package that craetes Database as well as ODBC driver for accessing data
> at enduser PC, using .Net VB

Friday, March 9, 2012

how to deploy cr9 with vb6.0

hello frenz,


i have to deploy an application devloped in vb6.0,sql server 2000,cr9.0 . using package and deployment wizard i made the package.but when i run it on client side i found the error that crqe.dll(crpe.dll,cr252000.dll) not found.
and so on about many dlls.

even though these dlls are added(at the time of packaging) and available in support folder.

help me where i'm wrong??????????

crqe.dll(crpe.dll,cr252000.dll) not found:(If you're including the dlls in your setup, maybe they aren't getting registered properly or maybe their dependencies are not being installed or registered properly. In CR 8.5, there's a file called runtime.hlp that tells what files are needed for distribution (and what dependencies are needed), maybe you have something similar in version 9?|||thanx malleyo,

as you suggested i got the help file runtime.chm in the crystal report folder. actually i needed to download merge modules for deployment of crystal report9.0

thanx again for your reply... :)|||In this shield used to create setup file for our project and install to anywhere.

In Installation shield support visual basic 6.0,.Net(windows application),Java(awt and swing application).

This installation shield in build contain Visual basic runtime file so we no need to have visual basic 6.0 on the client machine.
And shield in build conatin Java runtime environment JRE1.5 so we no need to have java on the client machine and support dotnetframework2x also. So we can use this shield easy.And easy to plugin system file also available.

In this Installation available for trail version.Contact mail installationshield@.yahoo.com.

Note:My company also used this shield|||I used the methods to deploy listed in the next link & they worked ok in all cases -->
http://www.psdn.com/library/entry.jspa?categoryID=33&externalID=1329

How to deploy a single package of a multiple package solution

Hi,

I have a multiple package solution that I've deployed using the manifest file produced with the development environment. If I need to make a change to a single package, how do I then deploy this package? Is it a case of rebuilding the entire solution and re-running the manifest file, or is there a simpler way?

Any help would be much appreciated, cheers.

Can't you just go into the bin folder of your solution and select the appropriate package then copy this to your desired location?|||

I've experienced some strange behaviour doing this in the past that was solved by redeploying the entire solution using the deployment wizard. So I wasn't sure if there was something going on with the registry that I wasn't appreciating.

Are you confident that simply copying a modified package to the SSIS package store location will work consistently?

|||

To be perfectly honest, I've never used the manifest or deployment utility. All I ever do is copy the package from the bin folder to my release folder. I then use the SQL package store and import from my release folder (although you can do this from your development directory, I like to keep one additional layer of last good build that I can reimport to the sql package store if worst comes to worst).

I do not believe that there is anything modified in the registry at any point in time during package deployment. I could very well be wrong, but from what I have read that is not the case. (NOTE: there is the possibility that you are using registry configurations, which you will need to set up in your new location)

-- From Microsoft SQL Server 2005 Integration Services by Kirk Haselden

"Integration Services provides a utility for moving packages, butfor a moment, let's take a step back and think about the deployment problem. What is it you're trying to accomplish? Is there something in the package, some setting or variable that can't be moved by simply copying the package to another machine? Not really. However, problems arise when you move a package that references external resources that are available on one machine that aren't available on another. For example, no amount of configuration magic is going to help if you attempt to run a package that references a custom task that isn't installed on the destination machine."

|||

Ah, maybe that is the answer, simply use the Import option to load modified packages to the SSIS package store. Thanks for taking the time to reply, much appreciated.

How to deploy a Package?

Hallo


I created my first Package and i am not able to deploy it in my SQL server.

I created a Development Utility and in the OutputPath i got a *.dtsx and a *.SSISDevelopmentManifest file.
When i run the packaage (*.dtsx) it works but when i try to install the package with *.SSISDevelopmentManifest it just genereates a folder in the selected Folder
(...\Microsoft SQL Server\90\DTS\Packages\) and no more.

What am i missing?

All the "Deployment" does is copy the *.dtsx files to the file system or MSDB on the target SQL server. You apparently selected "file system". It did exactly what it was suppose do.

Now you need to connect to the "Integration Services" on the server and look under "File System" and you will see the SSIS packages.|||

Hi soanfu,

When using the Deployment Utility, a directory is created in the Microsoft SQL Server\90\DTS\Packages\ folder. This happens regardless of where your package gets deployed. If the package gets deployed to the file system, the dtsx file will be copied into this directory. If you deploy to SQL Server, the directory is created but remains empty.

As someone else pointed out, connecting to the Integration Services instance will allow you to view all packages deployed to a server - both file system and SQL Server. To connect, open SQL Server Management Services. In the Object Explorer, click the Connect button. Select Integration Services and log in. You should be able to view packages stored to the SQL Server under the Stored Packages\MSDB folder.

Hope this helps,
Andy

|||

Thanks for the tip!

I didn’t know that there is a “Integration Services".

But know I have one more question.

In “Sql Server 2000” we could program the execution of DTS Packages with the option Tasks. How can I do it in SQL Server 2005?

|||You mean, to schedule it? You could use SQL Server Agent for that.

how to delete unused connection in DTS package

hi guys,
I have a dts package which has 2 unused connections, but I don't know
how to delete them using dts package designer... is that possible to do on U
I
level or
do I have to write a script to drop unused connections?
-kevI got it.. thanks anyway..
http://www.sqldts.com/default.aspx?253
"Kevin" wrote:

> hi guys,
> I have a dts package which has 2 unused connections, but I don't know
> how to delete them using dts package designer... is that possible to do on
UI
> level or
> do I have to write a script to drop unused connections?
> -kev