Showing posts with label returns. Show all posts
Showing posts with label returns. Show all posts

Monday, March 19, 2012

Create Report Parameters Dynamically

Hi there,
I was wandering if it is possible to create report parameters on the
fly.
for example. table returns one moment 3 values, other moment 6 values.
depending how many values i would like to create report parameters...
Could anyone help?
Greetz,
Hippo from [NL]
--
remove xxx from mailIf you want to have a parameter that is a combo box filled from a query
that is not problem. If you want to vary the number of parameters then that
is fixed. In layout tab, click on a part of the report (empty part), go to
the report menu, parameters.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"hippo" <nijlpaard.xxx@.gmail.com> wrote in message
news:00ma515285q2fmmgouguksq2t4l538mlhh@.4ax.com...
> Hi there,
> I was wandering if it is possible to create report parameters on the
> fly.
> for example. table returns one moment 3 values, other moment 6 values.
> depending how many values i would like to create report parameters...
> Could anyone help?
>
> Greetz,
> Hippo from [NL]
> --
> remove xxx from mail|||Hello, i got the same problem, only the following:
Depending on returned values i would like to create a combobox.
For example, my dataset or stored procedure returned [x] names, and each
name has 5 possible values. Depending on [x] i would like to create
dynamically parameters. Is this possible?
"Bruce L-C [MVP]" wrote:
> If you want to have a parameter that is a combo box filled from a query
> that is not problem. If you want to vary the number of parameters then that
> is fixed. In layout tab, click on a part of the report (empty part), go to
> the report menu, parameters.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "hippo" <nijlpaard.xxx@.gmail.com> wrote in message
> news:00ma515285q2fmmgouguksq2t4l538mlhh@.4ax.com...
> > Hi there,
> >
> > I was wandering if it is possible to create report parameters on the
> > fly.
> >
> > for example. table returns one moment 3 values, other moment 6 values.
> > depending how many values i would like to create report parameters...
> >
> > Could anyone help?
> >
> >
> > Greetz,
> > Hippo from [NL]
> > --
> > remove xxx from mail
>
>|||Search Books On-Line on the phrase cascading parameters
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"RamR0m" <RamR0m@.discussions.microsoft.com> wrote in message
news:D54159D9-4F2D-4BE9-8873-862332EABBCD@.microsoft.com...
> Hello, i got the same problem, only the following:
> Depending on returned values i would like to create a combobox.
> For example, my dataset or stored procedure returned [x] names, and each
> name has 5 possible values. Depending on [x] i would like to create
> dynamically parameters. Is this possible?
> "Bruce L-C [MVP]" wrote:
> > If you want to have a parameter that is a combo box filled from a query
> > that is not problem. If you want to vary the number of parameters then
that
> > is fixed. In layout tab, click on a part of the report (empty part), go
to
> > the report menu, parameters.
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "hippo" <nijlpaard.xxx@.gmail.com> wrote in message
> > news:00ma515285q2fmmgouguksq2t4l538mlhh@.4ax.com...
> > > Hi there,
> > >
> > > I was wandering if it is possible to create report parameters on the
> > > fly.
> > >
> > > for example. table returns one moment 3 values, other moment 6 values.
> > > depending how many values i would like to create report parameters...
> > >
> > > Could anyone help?
> > >
> > >
> > > Greetz,
> > > Hippo from [NL]
> > > --
> > > remove xxx from mail
> >
> >
> >|||Thank you Bruce for you reply, but this isn't what i wish.
What i understand of Cascading Parameters is that you have to predefine your
parameters before execution.
What i would like is to have is, depending on values returned by the
dataset, vary the amount of visual parameters.
Greetz, RamR0m
> > > --
> > > Bruce Loehle-Conger
> > > MVP SQL Server Reporting Services
"Bruce L-C [MVP]" wrote:
> Search Books On-Line on the phrase cascading parameters
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "RamR0m" <RamR0m@.discussions.microsoft.com> wrote in message
> news:D54159D9-4F2D-4BE9-8873-862332EABBCD@.microsoft.com...
> > Hello, i got the same problem, only the following:
> >
> > Depending on returned values i would like to create a combobox.
> > For example, my dataset or stored procedure returned [x] names, and each
> > name has 5 possible values. Depending on [x] i would like to create
> > dynamically parameters. Is this possible?
> >
> > "Bruce L-C [MVP]" wrote:
> >
> > > If you want to have a parameter that is a combo box filled from a query
> > > that is not problem. If you want to vary the number of parameters then
> that
> > > is fixed. In layout tab, click on a part of the report (empty part), go
> to
> > > the report menu, parameters.
> > >
> > >
> > > --
> > > Bruce Loehle-Conger
> > > MVP SQL Server Reporting Services
> > >
> > > "hippo" <nijlpaard.xxx@.gmail.com> wrote in message
> > > news:00ma515285q2fmmgouguksq2t4l538mlhh@.4ax.com...
> > > > Hi there,
> > > >
> > > > I was wandering if it is possible to create report parameters on the
> > > > fly.
> > > >
> > > > for example. table returns one moment 3 values, other moment 6 values.
> > > > depending how many values i would like to create report parameters...
> > > >
> > > > Could anyone help?
> > > >
> > > >
> > > > Greetz,
> > > > Hippo from [NL]
> > > > --
> > > > remove xxx from mail
> > >
> > >
> > >
>
>|||>From everything I've seen, the parameters are hard coded into the RDL,
and there is no way to dynamically add or remove parameters at report
run time. You may want to see if someone from Microsoft knows if this
is a wishlist item for future versions.
If you are letting Reporting Services prompt the user for parameters,
the best thing I can think of that you can do is define the maximum
number of parameters, then use cascading parameters in a way that the
unnecessary parameters only have a single choice called "Not
Applicable" or "Skip Me". If you have an application that is calling
the report, you could prompt the user only for the parameters that you
really care about, and then behind the scenes fill in the remaining
parameters with dummy values that aren't actually needed to generate
your report data.
Ted

Friday, February 24, 2012

CREATE FUNCTION?

Hello!

How can I make this function in MS SQL:

CREATE FUNCTION id_name() RETURNS INTEGER
AS 'SELECT MAX(ID)+1 FROM Test;'

Thanks!
Big Smile [:D]

CREATE FUNCTION id_name ()
RETURNS integer

AS


BEGIN


declare @.Return integer
@.return =SELECT MAX(ID)+1 FROM Test
return @.return

END

Limno

|||CREATE FUNCTION id_name RETURNS INTEGER
AS SELECT MAX(ID)+1 FROM Test

Create Extended Procedures in VS 2005

Hi

I am trying to write an extended procedure that accepts a string parameter and returns an integer value. The extended procedure calls a regular stored procedure of a database passing the string parameter as an input. The int value is an OUT parameter to this procedure.

Can I some one suggest where do I get started with respect to this in VS 2005.Why do you want to write an extended stored procedure to call a TSQL SP? This is overkill actually. Extended SPs are meant for computation intensive operations or other logic that cannot be performed efficiently using TSQL. It has it's limitations, performance, reliability and security issues. Or you trying to just learn extended SP programming? If later you can look at the SQL Server samples. You can also look at ODBC/OLEDB samples that will show you how to call SPs.|||The thing is that we need to make DML changes while calling a function. Since normal UDFs dont allow to do it I am trying to call an xp. Since we also need to look at concurrency I am having a stored procedure with transactions taken care. Hence the need of calling T_SQL sp from xp.|||Where do I look for the Extended Stored Procedure DLL Wizard while I open VS 2005 --> Open Project.

I do not see any such wizrd name.

Regards
Imtiaz|||

Use of side-effecting code from UDF is not recommended. It takes lot of work to get it right (dealing with bound connections, concurrency issues, deadlocks, scalability of xps, virtual memory issues depending on how the xp is written etc). Lastly, use of such UDFs in SELECT statement can cause unexpected behavior.

Tuesday, February 14, 2012

Create Database by using OSQL

I have to create database usign OSQL. i am usin a command like this

C:> osql -E -i db1.sql

But it doesnt create database and returns error saying user login
failed for administrator whereas I have no user for SQL server n it
uses by default . I also tried with sa username by entering it with -U
switch in command but still it gaves same error. Can anyone help meHi

You will need to post db1.sql to be certain. Try using the command without
specifying the file and see what it says. If you are not connecting to the
default instance/database then specify the server -S flag (it may be better
to do this regardless!) and database -d flag as well. If you are not an
administrator (or the BUILDIN\Administrators group has been removed from the
logins) then specifying -U sa -P<sa password>.

John

<arfanameer@.hotmail.com> wrote in message
news:1103900360.199670.188710@.z14g2000cwz.googlegr oups.com...
>I have to create database usign OSQL. i am usin a command like this
> C:> osql -E -i db1.sql
> But it doesnt create database and returns error saying user login
> failed for administrator whereas I have no user for SQL server n it
> uses by default . I also tried with sa username by entering it with -U
> switch in command but still it gaves same error. Can anyone help me|||arfanameer@.hotmail.com (arfanameer@.hotmail.com) writes:
> I have to create database usign OSQL. i am usin a command like this
> C:> osql -E -i db1.sql
> But it doesnt create database and returns error saying user login
> failed for administrator whereas I have no user for SQL server n it
> uses by default . I also tried with sa username by entering it with -U
> switch in command but still it gaves same error. Can anyone help me

If you get exactly the same error message if you specify "-U sa", then
the server is not configured for SQL authentication.

It would help if you posted the exact error message.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp