Showing posts with label process. Show all posts
Showing posts with label process. Show all posts

Wednesday, March 21, 2012

How to create an installer for deploying Sql Server Express

Hi,

I have created an installer for deploying Sql Server Express. My installer will start the process of installing Sql Server Express. However the installation of SqlServer Express will fail because it says another installer is currently running (which is my installer). Is there anyway to work around this problem?

The reason why I would like to create an installer for the installation of Sql Server Express is because I would like to configure the SqlServerExpress without the user fiddling with the ini file.

Thanks

Theses sources should help:

SQL Server 2005 UnAttended Installations
http://msdn2.microsoft.com/en-us/library/ms144259.aspx
http://msdn2.microsoft.com/en-us/library/bb264562.aspx
http://www.devx.com/dbzone/Article/31648

Deploy Database with MSI
http://msdn.microsoft.com/msdnmag/issues/04/09/customdatabaseinstaller/

Deploy Database with Application

http://www.codeproject.com/useritems/Deploy_your_database.asp

How to create a table and delete it thro codings in asp.net(sql server)

hai,

i want to create a table in a existing database in sql and i have to move data to the table and after my process i have to delete it .This is should be done thro codings.please help me.

Thanks in advance

Viswa

So you need to code it in sql scipts or you want do to it in asp.net c#, vb code

|||

using the code behind vb.net

Wednesday, March 7, 2012

How to count the tasks inside a package programmatically?

Hi there,

I'm trying to keep track of the ETL process inserting/updating a row in one table for each package that finish in my ETL process when executing. So far, I created a Script task that increments by one a variable (counter) and then open a connection to my database an insert/update my table. What I want to see is Step 1/30, Step 2/30 and so on. Right know I can display Step 1, Step 2 but how can I get the overall number of tasks within a package?

Thanks in advance for any help you can give me.

Sincerely,
Ricardo

A script task cannot interrogate the package in which it resides to find out that information. Unlike in DTS, tasks do not receive a pointer to package itself. So you can't do what you used to do in DTS i.e. Get a reference to DTSGlobalVariables.Parent and iterate over the object model.

This is one of the big differences in SSIS.

Some extra reading:

But it used to work in DTS (1) - Modifing a Package in script

(http://blogs.conchango.com/jamiethomson/archive/2006/06/28/SSIS_3A00_-But-it-used-to-work-in-DTS-_2800_1_2900_-_2D00_-Modifing-a-Package-in-script.aspx)

-Jamie

|||

You could handle the counting yourself - store one variable with the total count of steps, and another variable that you increment with script tasks as the package executes.

It's a little more work, but it should accomplish what you want.

|||

jwelch wrote:

You could handle the counting yourself - store one variable with the total count of steps, and another variable that you increment with script tasks as the package executes.

It's a little more work, but it should accomplish what you want.

Good idea. Thought you'll probably want to put the script task that increments the value into the OnPostExecute eventhandler scoped to the package.

-Jamie

|||Well, to get the count what I ended up doing is to call the package itself from a Script Task so I can do package.Executables.Count in order to get the total number of tasks inside a package.

I still used the Post-Execute event to increment my counter and to insert/update a row in my audit table.

Thank you guys for the suggestions.

Ricardo|||

bachocha wrote:

Well, to get the count what I ended up doing is to call the package itself from a Script Task so I can do package.Executables.Count in order to get the total number of tasks inside a package.

I still used the Post-Execute event to increment my counter and to insert/update a row in my audit table.

Thank you guys for the suggestions.

Ricardo

So you're building a package solely for the purpose of calling another package? You could of course write a .Net app to do this for you - I find it interesting that you chose not to and instead use SSIS itself as the host for your .Net code.

Anyway...I'm waffling. Glad you got what you wanted.

-Jamie

|||Actually, I think he's calling a new instance of the package from inside the same package. Seems like a lot of overhead, but to each his own.|||Yes, John is right. I'm loading the same package from inside my package using a Script Task. I was thinking to create a new package which only loads the package I want to get the number of tasks and then store this count into a variable.

I don't think I could use a .NET app, I mean I can build it but probably I will not be able to deploy it in production. I can only move dtsx packages. I really would like to implement the best solution for this problem. So if you think that loading the same pacakge from itself is an overhead, what would be the right way?

Thanks!

Ricardo|||

bachocha wrote:

Yes, John is right. I'm loading the same package from inside my package using a Script Task. I was thinking to create a new package which only loads the package I want to get the number of tasks and then store this count into a variable.

I don't think I could use a .NET app, I mean I can build it but probably I will not be able to deploy it in production. I can only move dtsx packages. I really would like to implement the best solution for this problem. So if you think that loading the same pacakge from itself is an overhead, what would be the right way?

Thanks!

Ricardo

Its not an overhead if it doesn't cause any problems. It seems like a strange thing to do but if it works for you - go for it.

-Jamie

|||

bachocha wrote:

So if you think that loading the same pacakge from itself is an overhead, what would be the right way?

"Right way" - I don't know. My comment about overhead was that you are essentially loading the package twice - once to do the real work, once to count the executables. Not a big deal if you are doing it in one or two packages. Across a few dozen, it might have more impact. However, just loading the package doesn't have the same overhead as executing it, so maybe it's not a problem. Like Jamie said, if it works for you, go with it.

Friday, February 24, 2012

How to copy SQL server logins from one server to another

Hi all...

I am in a process of copying all databases from a server to another. Both are running SQL Server 2000.

First of all, I tell you that I could not use "Copy Database Wizard" option because of a lot of problems with it. By using DTS didn't work either. Finally, the only solution was to backup the database first and then to restore it back to the new server. In such a case only database logins are restored, but not associated SQL server logins.

Is there a way to copy all SQL Server logins and link them to databases logins already created without the need of using sp_change_users_login procedure for each one?

Thanks a lot in advance

Jaime

I have found the solution by myself.

http://www.databasejournal.com/features/mssql/article.php/2228611

Thanks anyway

Jaime

|||

Hi,

you can script it...

You can use the enteprise manager(EM)

EM> in the console root> connect to the server>

> click on database>

> Right- click the database > click on all task

> Generate Sql scripts

in the generate sql script dialog

>Click on options

>Check Sql server logins

>click general tab and click preview

> run the scripts the other servers

hope it helps