Showing posts with label click. Show all posts
Showing posts with label click. Show all posts

Friday, March 30, 2012

Running an SSIS Package after a webpage button click

Hi all!
I'm a newbie when it comes to SSIS and web development (I'm currently in school for Mechanical Engineering). I'm trying to develop a website in which I can upload an excel file and have the contents written to a SQL database. I have been successful in creating a package in which I point to an excel file and it writes the contents to the desired database. With this, I was hoping that I can modify my website to take the file which is being uploaded, change the name, and then have the SSIS package run, in which it will look for the named file in a certain directory and upload the contents to the SQL server.

Ideally this would be the order of events:

User selects and uploads a file to the server (button click)
Server renames it and places it in a certain directory
SSIS package runs and extracts the data to SQL database

Thanks all!
Shrey

Sorry, I just realized that I didn't explicitly ask my question:

Is it possible to run a SSIS package when someone clicks on a button on a webpage?

|||Sure:
http://blogs.msdn.com/michen/archive/2007/03/22/running-ssis-package-programmatically.aspx|||Can someone show me some visual web developer code for a simple site which will run a SSIS package when someone clicks on a button?

|||

skshah39 wrote:

Can someone show me some visual web developer code for a simple site which will run a SSIS package when someone clicks on a button?

Did you read through all of the link I posted earlier? There are some links inside that page that should point you to some examples.

Wednesday, March 28, 2012

Running a Stored Procedure without passing parameters

HI all,

I'd like to run a simple stored procedure on the Event of a button click, for which I don't need to pass any parameters, I am aware how to run a Stored Procedure with parameters, but I don't know how without, any help would be appreciated please.

thanks.


The code would be similar to what you have if you had parameters. Just chop off the part of the code where you add the parameter.|||

thanks for that, however I can't use the normal way I used with parameters :

SQLDataSource1.InsertParameters("Till_Name").DefaultValue = tillname

As for the above I've used the InsertParameters method of my SQLDataSource1 object, which requires a parameter, although all I want to do is trigger a Stored Procedure. Do you follow?

|||

Have a look at the link

http://msdn2.microsoft.com/en-us/library/w1kdt8w2.aspx

Quoting the relevant portion from the link

"

If the database you are working with supports stored procedures, you can set theSelectCommand property to the name of the stored procedure and theSelectCommandType propertyStoredProcedure to indicate that theSelectCommand property refers to a stored procedure. The following example demonstrates a simple stored procedure that you can create in SQL Server:

CREATE PROCEDURE sp_GetAllEmployees AS
SELECT * FROM Employees;
GO

To configure theSqlDataSource to use this stored procedure, set theSelectCommand text to "sp_GetAllEmployees" and theSelectCommandType property toStoredProcedure.

Most stored procedures use parameters. For more information about using stored procedures with parameters, seeUsing Parameters with the SqlDataSource Control.

At run time,SqlDataSource control submits the text in theSelectCommand property to the database, and the database returns the result of the query or stored procedure to theSqlDataSource control. Any Web controls that are bound to the data source control display the result set on your ASP.NET page.

"

|||

thanks for that ambarsihg, I have my stored procedure as a SelectCommand, however my problem is the syntax of running the SelectCommand from a button press for example.

e.g.

SqlDataSource2.SelectCommandType = SqlDataSourceCommandType.StoredProcedureSqlDataSource2.SelectCommand()
This doesnt work, so how do I do it please?|||Dim myConnectionAsNew SqlConnection([your connection])
Dim myCommandAsNew SqlCommand("[your stored procedure]", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
myCommand.ExecuteNonQuery()

ExecuteNonQuery executes the Stored Procedure

|||Thanks very much, much head scratching avoided!Smile

Saturday, February 25, 2012

RULES and custom defaults in Express edition?

Does it allow you it create rules ? a right click does not present an option, as if you cannot. Going to try T-SQL to see if that works.

John

JohnF wrote:

Does it allow you it create rules ? a right click does not present an option, as if you cannot. Going to try T-SQL to see if that works.

John

No, but only when you want it to make up rules,|||

I see CHECK constraints is the way to go now

|||

Yep,

see ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/63e1bd15-d618-4ee4-a819-641137101816.htm or http://msdn2.microsoft.com/en-us/library/ms187615.aspx, they are deprecated.

Jens K. Suessmeyer.

http://www.sqlserver2005.de