Showing posts with label view. Show all posts
Showing posts with label view. Show all posts

Friday, March 30, 2012

How do I allow users to see reports

Hi,
I know I am being thick here, and should probably just read the manual, but
how do enable users to log on and view reports. I have gone in to the
Properties of the report folder where the report I want a user to see is
located. I then set the security options to add a user, assigning them the
browser role. The report then inherits that role of the folder. However,
when the user logs in to the site their homepage is completely blank. They
don't get all the buttons and the top and definitely no reports. What do I
still need to do? Please help.
TIA,
JarrydHi,
Nevermind this post. Sussed it out. I was being stupid.
TIA,
Jarryd
"Jarryd" <jarryd@.community.nospam> wrote in message
news:%23MRFbAMvHHA.3660@.TK2MSFTNGP06.phx.gbl...
> Hi,
> I know I am being thick here, and should probably just read the manual,
> but how do enable users to log on and view reports. I have gone in to the
> Properties of the report folder where the report I want a user to see is
> located. I then set the security options to add a user, assigning them
> the browser role. The report then inherits that role of the folder.
> However, when the user logs in to the site their homepage is completely
> blank. They don't get all the buttons and the top and definitely no
> reports. What do I still need to do? Please help.
> TIA,
> Jarryd
>

Wednesday, March 28, 2012

How do I add a new column to an existing Data Source View in SSRS?

I've got a table in my Data Source View that is one of our central entity
tables in our warehouse, and there are LOTS of relationship lines (Roles)
linking to this table. We've just added 6 new columns to this table, and I
need to add them to the Data Source View so the new columns will be available
to the end users running Report Builder.
I am pulling my hair out trying to find the option to add the new columns!
Completely removing and re-adding the table is NOT an option, as we have 37
relationship lines coming into this central entity table.Hello here,
From your description, my understanding of this issue is that, you add some
new columns in the source table in database and you want to reflect in the
Data Source View. If I am offset, please feel free to let me know.
Based on my research, you could not add the new column in the data source
view directly. My suggestion is that you could regenerate the model. Since
the wizard will generate the relationship automatically, you will not
concern about creating many relationships.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Hi Wei Lu,
Thanks for your post. The wizard does not automatically re-establish all
the relationship lines. These 37 relationship lines I had to manually create
the very first time when I generated the model, even though most of them
already have a foreign key in the database expressing the relationship. I do
not want to have to manually re-create all these relationship lines. Also, I
have other computed expression columns that would be blown away if I
re-generate the entire Data Source View using the Wizard. I would have to
manually recreate those as well.
"Wei Lu [MSFT]" wrote:
> Hello here,
> From your description, my understanding of this issue is that, you add some
> new columns in the source table in database and you want to reflect in the
> Data Source View. If I am offset, please feel free to let me know.
> Based on my research, you could not add the new column in the data source
> view directly. My suggestion is that you could regenerate the model. Since
> the wizard will generate the relationship automatically, you will not
> concern about creating many relationships.
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ==================================================> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>|||Hello,
I would like to suggest you use the Refresh button in the DSV designer,
then use the Generate option on the corresponding entity in the report
model.
Please let me know if this resolved your problem.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Perfect!! The Refresh button did the trick!! Thank you so much!
=Steve=
"Wei Lu [MSFT]" wrote:
> Hello,
> I would like to suggest you use the Refresh button in the DSV designer,
> then use the Generate option on the corresponding entity in the report
> model.
> Please let me know if this resolved your problem.
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ==================================================> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>|||Hello,
Glad to hear that you resolve this issue. If you have any question, please
feel free to let me know.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)

How do I add a data source view and report model to an existing project

I have an existing project with the data source and report folder with working reports. I need to create a model for other department members to use Report Builder, not Business Intelligence Developer Studio, to develop their reports from. How do I add a data source view and report model folder to the project so I can then create a view and model?

Report Models are part of a separate project type. Create a new "Report Model" project and you will be able to create the DSV and report model there.

sql

How do I access a SQL view in VB.Net?

I'm able to access my stored procedures just fine, but I can't query/show a view that I'd built in SQL Server. Any suggestions on how would be welcome.

Sample Stored Procedure reference, and I just want to reference a view now:


' Connect to the Database
Dim MyConn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("myConnectionString"))
' Establish the set of data commands and a database connection that are used to fill the dataset
Dim MyCommand As New SqlCommand("vw_Mast_PW_Accounts", MyConn)

MyCommand.CommandType = CommandType.StoredProcedure

MyConn.Open()

dgMyGrid.DataSource = MyCommand.ExecuteReader
dgMyGrid.DataBind()

MyConn.Close()

I might be mistaken here, but a view is treated pretty much like a table. So if you want to return data from a view, query against it as if it were a table: SELECT * FROM vw_myView WHERE ...

You'll need to make sure your web app has permissions to query the view and, I think, any underlying tables (though I might be wrong on that last point).|||That's great, but do is there a way to do it without using SQL but simply referencing it as I would a stored procedure (i.e., just the name)?

Thank you,
Brent|||I don't believe so, for that same reason that you couldn't do that with a table.

Youcould create a stored procedure that returned data from your view, if you really needed that functionality...|||I gave up and built the stored procedure to access that view. Thank you for the suggestion!

Brent

Monday, March 19, 2012

How can you optimize duplicated work in views?

This one's kind of hard to explain, so I've opted to post a simplified
version of our view that prompted me to ask this question: The
question is re-asked after the view...

create view MainView (
PrimaryKeyID,
SubTotal1,
SubTotal2,
GrandTotal
)
as

select t.PrimaryKeyID,
sum(t1.Total),
sum(t2.Total),
sum(t1.Total) + sum(t2.Total)
from SomeTable t
join CalculationTable t1 on ...
join AnotherCalculationTable t2 on ...

Notice in the 3rd column called "GrandTotal" how it calls the function
"sum" two more times. Common sense tells me that this is not
necessary. in our case it's orders of magnitude worse... Is the query
optimizer smart enough to only call these sums once per row in
"SomeTable"? Common sense tells me that if we were to break the views
apart into two views it would avoid this ineffeciency:

create view InnerView (
PrimaryKeyID,
SubTotal1,
SubTotal2
)
as

select t.PrimaryKeyID,
sum(t1.Total),
sum(t2.Total)
from SomeTable t
join CalculationTable t1 on ...
join AnotherCalculationTable t2 on ...

create view OuterView (
PrimaryKeyID,
SubTotal1,
SutTotal2,
GrandTotal
)
as

select iv.PrimaryKeyID,
iv.Total1,
iv.Total2,
iv.Total1 + iv.Total2
from InnerView

Notice how it appears that we've tricked the optimizer into thinking
there are less operations. So my question is how does views handle
this situation? Does the optimizer treat both version the same? Or is
one faster than the other? Or is there another, faster way? Does
adding levels of views slow down things, or are views simply like
macros and get removed when compiled (I think I've read the latter is
true actually)

Thanks,
Davemalcolm (chakachimp@.yahoo.com) writes:
> create view MainView (
> PrimaryKeyID,
> SubTotal1,
> SubTotal2,
> GrandTotal
> )
> as
> select t.PrimaryKeyID,
> sum(t1.Total),
> sum(t2.Total),
> sum(t1.Total) + sum(t2.Total)
> from SomeTable t
> join CalculationTable t1 on ...
> join AnotherCalculationTable t2 on ...
>
> Notice in the 3rd column called "GrandTotal" how it calls the function
> "sum" two more times. Common sense tells me that this is not
> necessary. in our case it's orders of magnitude worse... Is the query
> optimizer smart enough to only call these sums once per row in
> "SomeTable"? Common sense tells me that if we were to break the views
> apart into two views it would avoid this ineffeciency:

I ran this query in Northwind:

select OrderID, SUM(UnitPrice), SUM(Discount),
SUM(UnitPrice) + SUM(Discount)
from [Order Details]
group by OrderID

When I looked at the query plan, it appears to compute the first two sums
in a stream aggregate, and then computed the last sum as a sclar value,
being the sum of the two sums.

However, this may not at all be applicable to your actual query, since
your expressions may be more complex and not lend themselves to
arithmetic simplifications.

In general, though, I think you can trust the optimizer to do the
right thing. Rewriting the query in steps as you suggested, can just
as well make matters worse, since you could confuse the optimizer.
(Or even worse confuse yourself, so that you get incorrect results.)

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

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

Friday, March 9, 2012

How can one user view other users that belong to a database role?

After upgrading my database from SQL2000 to SQL2005 I have noticed a change in behavior of sp_helprolemember.

In SQL2000 I could connect as 'user1' and use sp_helprolemember to find all users that belong to a certain role.

In SQL2005 sp_helprolemember seems to only show me the roles that connected user belongs to. For example, if I connect as 'user1' I only see the roles that 'user1' belongs to.

Any advice on how to duplicate the behavior from SQL2000?

The procedure relies on the security catalog views which are user sensitive, the query which is executed behind the scenes will bring back only the roles for the user.

select DbRole = g.name, MemberName = u.name, MemberSID = u.sid

from sys.database_principals u, sys.database_principals g, sys.database_role_members m

where g.principal_id = m.role_principal_id

and u.principal_id = m.member_principal_id

order by 1, 2

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||Thanks for the post, however you've only explained why it's behaving as it does. I'm looking for advice on duplicating the Sql2000 behavior. For example, if I log on as user A I'd like to know if user B is a member of role ABC.|||Look what the Workbench does behind the scenes, it will execute the following commands:

set NOCOUNT OFF

CREATE TABLE #tmp_role_member_ids (id int not null, role_id int null, sub_role_id int null, generation int null)

declare @.generation int

set @.generation = 0

INSERT INTO #tmp_role_member_ids (id) SELECT

rl.principal_id AS [ID]

FROM

sys.database_principals AS rl

WHERE

(rl.type = 'R')and(rl.name=N'db_owner')

UPDATE #tmp_role_member_ids SET role_id = id, sub_role_id = id, generation=@.generation

WHILE ( 1=1 )

BEGIN

INSERT INTO #tmp_role_member_ids (id, role_id, sub_role_id, generation)

SELECT a.member_principal_id, b.role_id, a.role_principal_id, @.generation + 1

FROM sys.database_role_members AS a INNER JOIN #tmp_role_member_ids AS b

ON a.role_principal_id = b.id

WHERE b.generation = @.generation

if @.@.ROWCOUNT <= 0

break

set @.generation = @.generation + 1

END

DELETE #tmp_role_member_ids WHERE id in (SELECT

rl.principal_id AS [ID]

FROM

sys.database_principals AS rl

WHERE

(rl.type = 'R')and(rl.name=N'db_owner') )

UPDATE #tmp_role_member_ids SET generation = 0;

INSERT INTO #tmp_role_member_ids (id, role_id, generation)

SELECT distinct id, role_id, 1 FROM #tmp_role_member_ids

DELETE #tmp_role_member_ids WHERE generation = 0

SELECT

u.name AS [Name]

FROM

sys.database_principals AS rl

INNER JOIN #tmp_role_member_ids AS m ON m.role_id=rl.principal_id

INNER JOIN sys.database_principals AS u ON u.principal_id = m.id

WHERE

(rl.type = 'R')and(rl.name=N'db_owner')

ORDER BY

[Name] ASC

drop table #tmp_role_member_ids

HTH, Jens K. Suessmeyer.

-
http://www.sqlserver2005.de
-

How can one user view other users that belong to a database role?

After upgrading my database from SQL2000 to SQL2005 I have noticed a change in behavior of sp_helprolemember.

In SQL2000 I could connect as 'user1' and use sp_helprolemember to find all users that belong to a certain role.

In SQL2005 sp_helprolemember seems to only show me the roles that connected user belongs to. For example, if I connect as 'user1' I only see the roles that 'user1' belongs to.

Any advice on how to duplicate the behavior from SQL2000?

The procedure relies on the security catalog views which are user sensitive, the query which is executed behind the scenes will bring back only the roles for the user.

select DbRole = g.name, MemberName = u.name, MemberSID = u.sid

from sys.database_principals u, sys.database_principals g, sys.database_role_members m

where g.principal_id = m.role_principal_id

and u.principal_id = m.member_principal_id

order by 1, 2

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||Thanks for the post, however you've only explained why it's behaving as it does. I'm looking for advice on duplicating the Sql2000 behavior. For example, if I log on as user A I'd like to know if user B is a member of role ABC.|||Look what the Workbench does behind the scenes, it will execute the following commands:

set NOCOUNT OFF

CREATE TABLE #tmp_role_member_ids (id int not null, role_id int null, sub_role_id int null, generation int null)

declare @.generation int

set @.generation = 0

INSERT INTO #tmp_role_member_ids (id) SELECT

rl.principal_id AS [ID]

FROM

sys.database_principals AS rl

WHERE

(rl.type = 'R')and(rl.name=N'db_owner')

UPDATE #tmp_role_member_ids SET role_id = id, sub_role_id = id, generation=@.generation

WHILE ( 1=1 )

BEGIN

INSERT INTO #tmp_role_member_ids (id, role_id, sub_role_id, generation)

SELECT a.member_principal_id, b.role_id, a.role_principal_id, @.generation + 1

FROM sys.database_role_members AS a INNER JOIN #tmp_role_member_ids AS b

ON a.role_principal_id = b.id

WHERE b.generation = @.generation

if @.@.ROWCOUNT <= 0

break

set @.generation = @.generation + 1

END

DELETE #tmp_role_member_ids WHERE id in (SELECT

rl.principal_id AS [ID]

FROM

sys.database_principals AS rl

WHERE

(rl.type = 'R')and(rl.name=N'db_owner') )

UPDATE #tmp_role_member_ids SET generation = 0;

INSERT INTO #tmp_role_member_ids (id, role_id, generation)

SELECT distinct id, role_id, 1 FROM #tmp_role_member_ids

DELETE #tmp_role_member_ids WHERE generation = 0

SELECT

u.name AS [Name]

FROM

sys.database_principals AS rl

INNER JOIN #tmp_role_member_ids AS m ON m.role_id=rl.principal_id

INNER JOIN sys.database_principals AS u ON u.principal_id = m.id

WHERE

(rl.type = 'R')and(rl.name=N'db_owner')

ORDER BY

[Name] ASC

drop table #tmp_role_member_ids

HTH, Jens K. Suessmeyer.

-
http://www.sqlserver2005.de
-

Wednesday, March 7, 2012

How can i view the value of a variable during debug?

Thats the question... i can see the value of columns adding viewers, but how can i see variables?

Thanks!

Add a break point to one of your control flow tasks (by right clicking on it) and then when debug stops at that break point, you can go up to the Debug menu and select the Locals window to be displayed.|||

Thanks Phil,

I do that, but my variable doesnt appear in the window...

|||

Which window are you looking at? It should be in the Locals window; you have to expand the variables node...

|||

Sorry for my delay rafael, i was on holidays ;-)

I am looking at "Debug/windows/local variables", but nothing appears in this window.

Edit: I finally found the solution, the problem was taht i didnt insert the break point on control flow. Regards.

How can i view the value of a variable during debug?

Thats the question... i can see the value of columns adding viewers, but how can i see variables?

Thanks!

Add a break point to one of your control flow tasks (by right clicking on it) and then when debug stops at that break point, you can go up to the Debug menu and select the Locals window to be displayed.|||

Thanks Phil,

I do that, but my variable doesnt appear in the window...

|||

Which window are you looking at? It should be in the Locals window; you have to expand the variables node...

|||

Sorry for my delay rafael, i was on holidays ;-)

I am looking at "Debug/windows/local variables", but nothing appears in this window.

Edit: I finally found the solution, the problem was taht i didnt insert the break point on control flow. Regards.

how can i view the design of the ssis package after migration

OK, I was able to successfully migrate all of my DTS packages to SSIS, for SQL 2005. I can log into intergration services and see my packages listed under:

servername --> stored packages --> msdb. Now my question is, how can I open these packages, not run them open them in a design mode like you can in SQL 2000, you can double click on the package name and view the design of the package. how can i do that now that I have them in SQL 2005?

Right click on the package and select "Export..."

Chose File System as the destination and once done filling in the fields, you'll be able to open that package up in Business Intelligence Developer Studio.|||

Thanks, I tell ya, I should have walked away from this project when it was brought to me. Smile

Coming from coding .NET apps for the pass 6 years, this SQL style work is a whole new world to me.

|||It gives it a .dstx extension, is that correct?|||Yep, it sure is correct.|||

ok, thanks

how can i view customized error message?

hello
when error messages are added to my sql server, how can i view them?
i can not find them from the table (in master)
where does mssql 2000 store this information?
thank you
Hank,
Are you referring to master..sysmessages table?
Dinesh
SQL Server MVP
--
SQL Server FAQ at
http://www.tkdinesh.com
"hank" <anonymous@.discussions.microsoft.com> wrote in message
news:7DE6C377-84FF-411D-BCDD-A12848CA58C5@.microsoft.com...
> hello
> when error messages are added to my sql server, how can i view them?
> i can not find them from the table (in master)
> where does mssql 2000 store this information?
> thank you
|||thank you!!

how can i view customized error message?

hello
when error messages are added to my sql server, how can i view them?
i can not find them from the table (in master)
where does mssql 2000 store this information?
thank youHank,
Are you referring to master..sysmessages table?
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"hank" <anonymous@.discussions.microsoft.com> wrote in message
news:7DE6C377-84FF-411D-BCDD-A12848CA58C5@.microsoft.com...
> hello
> when error messages are added to my sql server, how can i view them?
> i can not find them from the table (in master)
> where does mssql 2000 store this information?
> thank you|||thank you!!

how can i view customized error message?

hell
when error messages are added to my sql server, how can i view them
i can not find them from the table (in master
where does mssql 2000 store this information
thank youHank,
Are you referring to master..sysmessages table?
--
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"hank" <anonymous@.discussions.microsoft.com> wrote in message
news:7DE6C377-84FF-411D-BCDD-A12848CA58C5@.microsoft.com...
> hello
> when error messages are added to my sql server, how can i view them?
> i can not find them from the table (in master)
> where does mssql 2000 store this information?
> thank you|||thank you!!