Showing posts with label parameter. Show all posts
Showing posts with label parameter. Show all posts

Wednesday, March 28, 2012

running a script which accepts a parameter against SQL2000 database

Hi there,
I'm fairly new to this stuff - I want to write a batch file or small
vbscript app that will aceept a parameter and then insert this into a
simple update command and execute agaisnt a SQL2000 database. andy help
appreciated!!
Cheers,
Paulat this link you can find about connecting to SQL server and adding new
records to a table using ADO
http://www.microsoft.com/technet/scriptcenter/scripts/misc/database/default.mspx?mfr=true
for using command line arguments, this link:
http://www.microsoft.com/technet/scriptcenter/resources/tales/sg0704.mspx
--
urkec
"pauls1888" wrote:
> Hi there,
> I'm fairly new to this stuff - I want to write a batch file or small
> vbscript app that will aceept a parameter and then insert this into a
> simple update command and execute agaisnt a SQL2000 database. andy help
> appreciated!!
> Cheers,
> Paul
>|||Look up batch files, using replaceable parameters, and then using SQL Server
Books Online, check out osql.
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"pauls1888" <pauls1888@.gmail.com> wrote in message
news:1164726964.399837.44300@.45g2000cws.googlegroups.com...
> Hi there,
> I'm fairly new to this stuff - I want to write a batch file or small
> vbscript app that will aceept a parameter and then insert this into a
> simple update command and execute agaisnt a SQL2000 database. andy help
> appreciated!!
> Cheers,
> Paul
>|||Thanks for the help guys

running a script which accepts a parameter against SQL2000 database

Hi there,
I'm fairly new to this stuff - I want to write a batch file or small
vbscript app that will aceept a parameter and then insert this into a
simple update command and execute agaisnt a SQL2000 database. andy help
appreciated!!
Cheers,
Paul
at this link you can find about connecting to SQL server and adding new
records to a table using ADO
http://www.microsoft.com/technet/scriptcenter/scripts/misc/database/default.mspx?mfr=true
for using command line arguments, this link:
http://www.microsoft.com/technet/scriptcenter/resources/tales/sg0704.mspx
urkec
"pauls1888" wrote:

> Hi there,
> I'm fairly new to this stuff - I want to write a batch file or small
> vbscript app that will aceept a parameter and then insert this into a
> simple update command and execute agaisnt a SQL2000 database. andy help
> appreciated!!
> Cheers,
> Paul
>
|||Look up batch files, using replaceable parameters, and then using SQL Server
Books Online, check out osql.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"pauls1888" <pauls1888@.gmail.com> wrote in message
news:1164726964.399837.44300@.45g2000cws.googlegrou ps.com...
> Hi there,
> I'm fairly new to this stuff - I want to write a batch file or small
> vbscript app that will aceept a parameter and then insert this into a
> simple update command and execute agaisnt a SQL2000 database. andy help
> appreciated!!
> Cheers,
> Paul
>
|||Thanks for the help guys
sql

running a script which accepts a parameter against SQL2000 database

Hi there,
I'm fairly new to this stuff - I want to write a batch file or small
vbscript app that will aceept a parameter and then insert this into a
simple update command and execute agaisnt a SQL2000 database. andy help
appreciated!!
Cheers,
PaulLook up batch files, using replaceable parameters, and then using SQL Server
Books Online, check out osql.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"pauls1888" <pauls1888@.gmail.com> wrote in message
news:1164726964.399837.44300@.45g2000cws.googlegroups.com...
> Hi there,
> I'm fairly new to this stuff - I want to write a batch file or small
> vbscript app that will aceept a parameter and then insert this into a
> simple update command and execute agaisnt a SQL2000 database. andy help
> appreciated!!
> Cheers,
> Paul
>|||Thanks for the help guys

Monday, March 26, 2012

Running a job from a Report using a button? (Is that possible)

Here is the deal. We have a mapping table that stores basic info (like
4 columns). These columns are used to populate parameter boxes in a
report (some parameters depend on the values of others and so we had
to use a mapping table for performance increase). The mapping table
is loaded hourly using a job that calls an SSIS package. Simple
stuff. However, let's assume the user logs in at 12:30 and there is
new data that is not showing, they cannot wait 30 minutes until the
job runs again. At the same time, we can't make the job run that
frequently. So we want to set up a "button" that the users can click
on and it will allow the job to run. We cannot have the job run every
time the report is loaded, takes too much time and would defeat the
purpose of performance enhancement.
So far I have this script in a dataset that points to the msdb
database on our reporting box:
exec dbo.sp_start_job @.job_id=N'd6ca06e2-73c4-4fe0-8924-b24bdc8cc78e''
I put it as a text command and it works fine, BUT ASKS ME FOR THE JOB
ID!!! I've pressed the ... button near the dataset to try to hard
code the parameter there, no luck.
Also, what would I use to add the user functionality, namely them
being able to click on something to invoke the job?
Thank you so much.I would like add buton to rerun an SSIS package. How did you add a button in
RS?
"Ayman" wrote:
> Here is the deal. We have a mapping table that stores basic info (like
> 4 columns). These columns are used to populate parameter boxes in a
> report (some parameters depend on the values of others and so we had
> to use a mapping table for performance increase). The mapping table
> is loaded hourly using a job that calls an SSIS package. Simple
> stuff. However, let's assume the user logs in at 12:30 and there is
> new data that is not showing, they cannot wait 30 minutes until the
> job runs again. At the same time, we can't make the job run that
> frequently. So we want to set up a "button" that the users can click
> on and it will allow the job to run. We cannot have the job run every
> time the report is loaded, takes too much time and would defeat the
> purpose of performance enhancement.
> So far I have this script in a dataset that points to the msdb
> database on our reporting box:
> exec dbo.sp_start_job @.job_id=N'd6ca06e2-73c4-4fe0-8924-b24bdc8cc78e''
> I put it as a text command and it works fine, BUT ASKS ME FOR THE JOB
> ID!!! I've pressed the ... button near the dataset to try to hard
> code the parameter there, no luck.
> Also, what would I use to add the user functionality, namely them
> being able to click on something to invoke the job?
> Thank you so much.
>|||Hi,
I think the problem is the "@.". Try to use a sproc instead of a text
command.
"Ayman" <aymantg@.gmail.com> schrieb im Newsbeitrag
news:1184855299.083046.294670@.z24g2000prh.googlegroups.com...
> Here is the deal. We have a mapping table that stores basic info (like
> 4 columns). These columns are used to populate parameter boxes in a
> report (some parameters depend on the values of others and so we had
> to use a mapping table for performance increase). The mapping table
> is loaded hourly using a job that calls an SSIS package. Simple
> stuff. However, let's assume the user logs in at 12:30 and there is
> new data that is not showing, they cannot wait 30 minutes until the
> job runs again. At the same time, we can't make the job run that
> frequently. So we want to set up a "button" that the users can click
> on and it will allow the job to run. We cannot have the job run every
> time the report is loaded, takes too much time and would defeat the
> purpose of performance enhancement.
> So far I have this script in a dataset that points to the msdb
> database on our reporting box:
> exec dbo.sp_start_job @.job_id=N'd6ca06e2-73c4-4fe0-8924-b24bdc8cc78e''
> I put it as a text command and it works fine, BUT ASKS ME FOR THE JOB
> ID!!! I've pressed the ... button near the dataset to try to hard
> code the parameter there, no luck.
> Also, what would I use to add the user functionality, namely them
> being able to click on something to invoke the job?
> Thank you so much.
>

running a job dyanamically

Hi All,
I have stored procedure which accepts an input
parameter.
I want to execute this stored procedure using a job.
This job will be executed based on an alert. How do I
pass the input parameter dynamically.
I am elaborating by giving an example.
a) procTest accepts a parameter @.n INT
b) There is a job called jobTest which has a step
stpTest which executes procTest @.n
c) If alertA fires I want to execute procTest 1
If alertB fires I want to execute procTest 2
If alertC fires I want to execute procTest 3
I hope I am clear with my question. Is it possible to do
this, or do I need to write seperate jobs for each alert
and hard code the parameter for the stored procedure.
Thanks in advance
AnandGuess the SP could look in sysalerts to see the last one that fired -
but would probably need to hold info for each alert in case multple
alerts fired at the same time (just save the last count for each alert
and check it to see what to process).
A lot easier to just define multiple jobs.
Posted via http://dbforums.com

Wednesday, March 21, 2012

Run Time parameter query

Why is it that I can create a parameter query in Enterprise Manager but
cannot repeat this in query analyser? How could I create a run time parameter
query (in my parlance a query that allows users to input values)!?
Thanks
SamOn Tue, 18 Jan 2005 03:29:03 -0800, Sam wrote:
>Why is it that I can create a parameter query in Enterprise Manager but
>cannot repeat this in query analyser? How could I create a run time parameter
>query (in my parlance a query that allows users to input values)!?
>Thanks
>Sam
Hi Sam,
This can't be done. Interaction with the end user (like asking for a
parameter) must be handled by the client application.
EM apparently has some support for asking parameter values. QA doesn't.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||SQL Server is a back-end server. It cannot ask a user for any parameters since SQL Server runs only
on the server. Possibly EM has some facility to ask for a parameter value, but that would be a
feature in EM. In SQL Server, you typically use stored procedures, where a stored procedure can take
a number of parameters, where the parameters are used inside the query or queries inside the
procedure.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Sam" <Sam@.discussions.microsoft.com> wrote in message
news:3755656C-5C1E-4AB5-9018-68B80F3FA855@.microsoft.com...
> Why is it that I can create a parameter query in Enterprise Manager but
> cannot repeat this in query analyser? How could I create a run time parameter
> query (in my parlance a query that allows users to input values)!?
> Thanks
> Sam
>sql

Run Time parameter query

Why is it that I can create a parameter query in Enterprise Manager but
cannot repeat this in query analyser? How could I create a run time parameter
query (in my parlance a query that allows users to input values)!?
Thanks
Sam
On Tue, 18 Jan 2005 03:29:03 -0800, Sam wrote:

>Why is it that I can create a parameter query in Enterprise Manager but
>cannot repeat this in query analyser? How could I create a run time parameter
>query (in my parlance a query that allows users to input values)!?
>Thanks
>Sam
Hi Sam,
This can't be done. Interaction with the end user (like asking for a
parameter) must be handled by the client application.
EM apparently has some support for asking parameter values. QA doesn't.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
|||SQL Server is a back-end server. It cannot ask a user for any parameters since SQL Server runs only
on the server. Possibly EM has some facility to ask for a parameter value, but that would be a
feature in EM. In SQL Server, you typically use stored procedures, where a stored procedure can take
a number of parameters, where the parameters are used inside the query or queries inside the
procedure.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Sam" <Sam@.discussions.microsoft.com> wrote in message
news:3755656C-5C1E-4AB5-9018-68B80F3FA855@.microsoft.com...
> Why is it that I can create a parameter query in Enterprise Manager but
> cannot repeat this in query analyser? How could I create a run time parameter
> query (in my parlance a query that allows users to input values)!?
> Thanks
> Sam
>

Run Time parameter query

Why is it that I can create a parameter query in Enterprise Manager but
cannot repeat this in query analyser? How could I create a run time paramete
r
query (in my parlance a query that allows users to input values)!?
Thanks
SamOn Tue, 18 Jan 2005 03:29:03 -0800, Sam wrote:

>Why is it that I can create a parameter query in Enterprise Manager but
>cannot repeat this in query analyser? How could I create a run time paramet
er
>query (in my parlance a query that allows users to input values)!?
>Thanks
>Sam
Hi Sam,
This can't be done. Interaction with the end user (like asking for a
parameter) must be handled by the client application.
EM apparently has some support for asking parameter values. QA doesn't.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||SQL Server is a back-end server. It cannot ask a user for any parameters sin
ce SQL Server runs only
on the server. Possibly EM has some facility to ask for a parameter value, b
ut that would be a
feature in EM. In SQL Server, you typically use stored procedures, where a s
tored procedure can take
a number of parameters, where the parameters are used inside the query or qu
eries inside the
procedure.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Sam" <Sam@.discussions.microsoft.com> wrote in message
news:3755656C-5C1E-4AB5-9018-68B80F3FA855@.microsoft.com...
> Why is it that I can create a parameter query in Enterprise Manager but
> cannot repeat this in query analyser? How could I create a run time parame
ter
> query (in my parlance a query that allows users to input values)!?
> Thanks
> Sam
>

Tuesday, March 20, 2012

Run report automatically when a parameter changes

I have a report with 6 parameters. They all have defaults so it is run
immediately when opened. Is there a way to run the report automatically when
any of the parameters is changed by the user instead of requiring the user to
click on the View Report button?
StephanieOn May 1, 10:05 am, Stephanie <Stepha...@.discussions.microsoft.com>
wrote:
> I have a report with 6 parameters. They all have defaults so it is run
> immediately when opened. Is there a way to run the report automatically when
> any of the parameters is changed by the user instead of requiring the user to
> click on the View Report button?
> Stephanie
As far as I know, there is not. That said, the auto-refresh time can
be set as part of the report properties; however, I don't think that
it will refresh w/the new parameter selections. Sorry that I could not
be of further assistance.
Regards,
Enrique Martinez
Sr. Software Consultant

Run report after parameter selected

My report has a Date parameter. Can the report be run automatically after the date is changed without clicking on View Report button?

Thanks

I don't think it can. The toolbar is generated by the reportserver and you can't hook into any events and there is no Autorun option to my knowledge.

The only hack I can think of is displaying the report in a custom page, view the source to find out the ids/names that RS assigns to your parameters and the name of the js function called when the "View Report" button is pressed. You then write some javascript that hooks into the onChage event of the dropdown and simulate the pressing of the button by calling the relevant function manually.

Like I said that is a real hack and is not likely to be very flexible but you could experiment. Eaither way you can't modify the Report Manager to do this you would have to write a custom page.

Friday, March 9, 2012

Run Dynamic Query Using Stored Procedure

Hi,

I need to create a stored procedure, which needs to accept the column name and table name as input parameter,

and form the select query at the run time with the given column name and table name..

my procedure is,

CREATE PROC spTest

@.myColumn varchar(100) ,

@.myTable varchar(100)

AS

SELECT @.myColumn FROM @.myTable

GO

This one showing me the error,

stating that myTable is not declared..

..........as i need to perform this type of query for more than 10 tables.. i need the stored procedure to accept the column and table as parameters..

Plese help me?? Is it possible in stored procedure..

DECLARE @.sql as Char(500) -- or whatever length is needed
SELECT @.sql = 'SELECT ' + @.myColumn + ' FROM ' + @.myTable
EXEC(@.sql)