Showing posts with label int. Show all posts
Showing posts with label int. Show all posts

Monday, March 19, 2012

How to get scrollbar for a subreport

Hi,

Can anyone tell me how to get a scrollbar inside a subreport.I'm using SQL Server 2005 Business Int. Solution.I'm having more than 1000 rows for a subreport.I want to fix the width and hieght of the subreport so that i can get a scrollbar in the subreport.Please, help me regarding this.

Thanks,

Saradhi

This is easy to do with a report viewer using Visual Studio 2005. I'm not sure how to do this using SQL Server 2005 BIS.

|||

Hi,

Yes.It can be done in Visual Studio 2005 using reportviewer control.But i don't know with SQL Server 2005 BIS. Anyway, thanks for the reply.

Thanks,

Saradhi

Friday, March 9, 2012

How to get rank?

I would like to write a query that gives me the values of a set of
observations, and their rank.

CREATE TABLE #Values(val int)
INSERT #Values SELECT 1
INSERT #Values SELECT 5
INSERT #Values SELECT 10

I would like to select this:

1 10 -- rank 1, value 10
2 5
3 1

I can put them into a temp table with an identity column, ordered by
the column I'm interested in, and then retrieve in order by the
identity column. I'm wondering if there's a way to do that with a
subquery.

Thanks,
JimRunning count is one way

CREATE TABLE #Values(val int)
INSERT #Values SELECT 1
INSERT #Values SELECT 5
INSERT #Values SELECT 10

select (select count(*) from #Values v where val <= v2.Val) as Rank,*
from #Values v2
order by 2

Denis the SQL Menace
http://sqlservercode.blogspot.com/

jim_geiss...@.countrywide.com wrote:
> I would like to write a query that gives me the values of a set of
> observations, and their rank.
> CREATE TABLE #Values(val int)
> INSERT #Values SELECT 1
> INSERT #Values SELECT 5
> INSERT #Values SELECT 10
> I would like to select this:
> 1 10 -- rank 1, value 10
> 2 5
> 3 1
> I can put them into a temp table with an identity column, ordered by
> the column I'm interested in, and then retrieve in order by the
> identity column. I'm wondering if there's a way to do that with a
> subquery.
> Thanks,
> Jim|||Jim,

if you are using SS 2005 , use row_number() or rank() OLAP function|||Where do you want to show data?
If you use front end application, do Ranking there

Madhivanan


jim_geissman@.countrywide.com wrote:

Quote:

Originally Posted by

> I would like to write a query that gives me the values of a set of
> observations, and their rank.
> CREATE TABLE #Values(val int)
> INSERT #Values SELECT 1
> INSERT #Values SELECT 5
> INSERT #Values SELECT 10
> I would like to select this:
> 1 10 -- rank 1, value 10
> 2 5
> 3 1
> I can put them into a temp table with an identity column, ordered by
> the column I'm interested in, and then retrieve in order by the
> identity column. I'm wondering if there's a way to do that with a
> subquery.
> Thanks,
> Jim

Sunday, February 19, 2012

How to get field value from a dynamic table in stored procedure

In my stored procedure,I want get some fields' value from a dynamic
table,something look like below:
PROCEDURE GetFileds
(
@.Field1 INT,
@.Field2 VARCHAR(255),
@.Table VARCHAR(255)
)
AS
--I want to get two fields from table which's name was passed by
paramerter.
SELECT
@.Field1 = FIELD1,
@.Field2 = FIELD2
FROM
@.Table
--Show @.Filed1 and @.Field2's Value
PRINT CONVERT(VARCHAR(255), @.Field1)
PRINT @.Field2
How to do that?I use EXECUTE() function,but the table name can't be
dynamic.debussy@.gmail.com wrote:
> In my stored procedure,I want get some fields' value from a dynamic
> table,something look like below:
> PROCEDURE GetFileds
> (
> @.Field1 INT,
> @.Field2 VARCHAR(255),
> @.Table VARCHAR(255)
> )
> AS
> --I want to get two fields from table which's name was passed by
> paramerter.
> SELECT
> @.Field1 = FIELD1,
> @.Field2 = FIELD2
> FROM
> @.Table
> --Show @.Filed1 and @.Field2's Value
> PRINT CONVERT(VARCHAR(255), @.Field1)
> PRINT @.Field2
> How to do that?I use EXECUTE() function,but the table name can't be
> dynamic.
My suggestion wold be not to do this. But read this article:
http://www.sommarskog.se/dynamic_sql.html
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"|||(debussy@.gmail.com) writes:
> In my stored procedure,I want get some fields' value from a dynamic
> table,something look like below:
> PROCEDURE GetFileds
> (
> @.Field1 INT,
> @.Field2 VARCHAR(255),
> @.Table VARCHAR(255)
> )
> AS
> --I want to get two fields from table which's name was passed by
> paramerter.
> SELECT
> @.Field1 = FIELD1,
> @.Field2 = FIELD2
> FROM
> @.Table
> --Show @.Filed1 and @.Field2's Value
> PRINT CONVERT(VARCHAR(255), @.Field1)
> PRINT @.Field2
> How to do that?I use EXECUTE() function,but the table name can't be
> dynamic.
A counter-question, why? If this is how you want to program SQL, forget
about stored procedures and send the queries from the client. That will
make your life easier.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp