Showing posts with label returned. Show all posts
Showing posts with label returned. Show all posts

Thursday, March 29, 2012

Extract "GroupName" from "sp_helpuser"

Hi all,

I want to create a stored procedure which will extract the "GroupName"
from the record returned by "sp_helpuser". In order to do this I need
to execute "sp_helpuser" which returns the entire record. I want to
just extract the "GroupName" from the record and return it to my
application. How do I go about this?

Thanks in advance,

AlvinAlvin Sebastian (asebastian@.cmri.usyd.edu.au) writes:
> I want to create a stored procedure which will extract the "GroupName"
> from the record returned by "sp_helpuser". In order to do this I need
> to execute "sp_helpuser" which returns the entire record. I want to
> just extract the "GroupName" from the record and return it to my
> application. How do I go about this?

Either you access sysusers directly, you can use the INSERT EXEC construct:

INSERT #temp (...)
EXEC sp_helpuser

You need to create #temp so that it agrees with the output from sp_helpuser.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

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

By the way, I forgot to mention in the first post that I'm only
interested in the "GroupName" of the currently logged-on user so the
stored procedure will be returning a single string value only and not
a table. How should the stored procedure return this single value from
the record returned by "sp_helpuser"?

Alvin

Erland Sommarskog <sommar@.algonet.se> wrote in message news:<Xns93BF646E19EF7Yazorman@.127.0.0.1>...
> Alvin Sebastian (asebastian@.cmri.usyd.edu.au) writes:
> > I want to create a stored procedure which will extract the "GroupName"
> > from the record returned by "sp_helpuser". In order to do this I need
> > to execute "sp_helpuser" which returns the entire record. I want to
> > just extract the "GroupName" from the record and return it to my
> > application. How do I go about this?
> Either you access sysusers directly, you can use the INSERT EXEC construct:
> INSERT #temp (...)
> EXEC sp_helpuser
> You need to create #temp so that it agrees with the output from sp_helpuser.|||Alvin Sebastian (asebastian@.cmri.usyd.edu.au) writes:
> By the way, I forgot to mention in the first post that I'm only
> interested in the "GroupName" of the currently logged-on user so the
> stored procedure will be returning a single string value only and not
> a table. How should the stored procedure return this single value from
> the record returned by "sp_helpuser"?

A one-row result set is still a table.

There is the OPENQUERY method as well.

See http://www.algonet.se/~sommar/share_data.html where I discuss both
methods.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks Erland, I got it working now!

Friday, March 23, 2012

Extending the number of rows returned per page in RS

Is there a way to extend the number of rows that will be returned so that Reporting services doesn't display such a large number of pages for the users to page through? It would be easier for them to "wheel mouse" through a long page on the screen.

Anyone out there have any thoughts on how this might be accomplished?

Thanks!

Travis

Here are a couple of options:

- set PageBreakAtEnd and PageBreakAtStart to false on your tables/matrices/grouping panels

- make your row heights smaller, use a smaller font

- filter your data better, or group it into smaller groups and have each group rendered into its own table, turn off paging on those tables

But turning off paging looks okay when viewing the report in the browser, but can make the report look like *** when exported to PDF.