Showing posts with label understanding. Show all posts
Showing posts with label understanding. Show all posts

Sunday, March 25, 2012

Data source and data set confusion

Maybe I am not understanding the way that these things work, but a little help would be apperciated.

I want to set up my shared data sources and "write them in stone". To be honest, once a data source has been set up, there should be no reason the change it unless a login credential changes, or we change the name of a database; changes to data sources should be done by a senior admin (like me!). All fine so far? Good...

Are data sets associated with/bound exclusively to the report, or the data source? For example, if I tie down my data sources and find a way to make them unchangeable, I then want myself and my collegues to be able to create/modify/delete data sets associated with the shared data source. If I do this, and then deploy my report (with overwrite datasources set to false) will they then work?

If the above is possible, is there a way that I can tie down the data sources so that only a select few can modify them? This would be a minimum requisit for a reporting manager (like me) where we have many developers creating reports and writing (and over-writing!) shared datasources - and causing a report completely unconnected with their current work to fail.

I realise that my experience is limited, and that SQL Reporting Services is young, but it is such a powerful product I can see it being used extensively across many industries in the future - mainly because it kicks Crystal in to touch on so many points.

OK, well, witha little experimentation, I have managed to answer part of my question. The data set is associated with the report, so setting the properties of the solution, over write data sources to false, I can create reports with custom data sets - no problems. Now for the tricky bit...

Does anyone have any as to how I can tie down the data source? It is accessible via Visual Studio, and the solution properties are easily changeable. Also, once these shared data sources are tied down, how does one add them to a solution? I can only find a way to add new data source, and then make it shared.

I have logged on to the reporting services area in SSMS and can see the security part, but how do I associate individuals to new roles in there? They will be domain roles, btw.

Thoughts/suggestions anyone?

sql

Sunday, February 19, 2012

data in the header

It is my understanding that data items can not exist in a header (or
footer). Yet in multi page reports it is often a requirement to reprint a
heading that has data in it. What is the best way to address this issue?
Thanks,
Garycreate read-only parameter with default value from query and then to use
this parameter in the page header textbox.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Gary D." <Dean@.nospam.com> wrote in message
news:%23F1%233OVhEHA.1768@.TK2MSFTNGP10.phx.gbl...
> It is my understanding that data items can not exist in a header (or
> footer). Yet in multi page reports it is often a requirement to reprint a
> heading that has data in it. What is the best way to address this issue?
> Thanks,
> Gary
>|||Lev:
Sorry, but I've looked through the docs (no search capability) and I just
can't figure out what you mean. could you pleas elaborate on what a
read-only parameter is? I have never worked with reporting software before
where putting data in the heading was problem.
Thanks,
Gary
"Lev Semenets [MSFT]" <levs@.microsoft.com> wrote in message
news:uvsl$ZVhEHA.2784@.TK2MSFTNGP09.phx.gbl...
> create read-only parameter with default value from query and then to use
> this parameter in the page header textbox.
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> "Gary D." <Dean@.nospam.com> wrote in message
> news:%23F1%233OVhEHA.1768@.TK2MSFTNGP10.phx.gbl...
> > It is my understanding that data items can not exist in a header (or
> > footer). Yet in multi page reports it is often a requirement to reprint
a
> > heading that has data in it. What is the best way to address this
issue?
> > Thanks,
> > Gary
> >
> >
>|||Here is some info about adding parameters :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rshowto/htm/hrs_designer_v1_38du.asp
You need to create a parameter with no prompt (If the prompt is left blank,
and a default parameter value is specified, the default value is used, and
the input box for the parameter is not displayed when the user runs the
report), set default value to "From query" and select dataset and field for
default value.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Gary D." <Dean@.nospam.com> wrote in message
news:O8oRF2ghEHA.2620@.TK2MSFTNGP10.phx.gbl...
> Lev:
> Sorry, but I've looked through the docs (no search capability) and I just
> can't figure out what you mean. could you pleas elaborate on what a
> read-only parameter is? I have never worked with reporting software
> before
> where putting data in the heading was problem.
> Thanks,
> Gary
> "Lev Semenets [MSFT]" <levs@.microsoft.com> wrote in message
> news:uvsl$ZVhEHA.2784@.TK2MSFTNGP09.phx.gbl...
>> create read-only parameter with default value from query and then to use
>> this parameter in the page header textbox.
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>> "Gary D." <Dean@.nospam.com> wrote in message
>> news:%23F1%233OVhEHA.1768@.TK2MSFTNGP10.phx.gbl...
>> > It is my understanding that data items can not exist in a header (or
>> > footer). Yet in multi page reports it is often a requirement to
>> > reprint
> a
>> > heading that has data in it. What is the best way to address this
> issue?
>> > Thanks,
>> > Gary
>> >
>> >
>>
>|||It works great, but you must add the RS parameter in the stored procedure.
Without this, you'll have an error.
"Lev Semenets [MSFT]" wrote:
> Here is some info about adding parameters :
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rshowto/htm/hrs_designer_v1_38du.asp
> You need to create a parameter with no prompt (If the prompt is left blank,
> and a default parameter value is specified, the default value is used, and
> the input box for the parameter is not displayed when the user runs the
> report), set default value to "From query" and select dataset and field for
> default value.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Gary D." <Dean@.nospam.com> wrote in message
> news:O8oRF2ghEHA.2620@.TK2MSFTNGP10.phx.gbl...
> > Lev:
> > Sorry, but I've looked through the docs (no search capability) and I just
> > can't figure out what you mean. could you pleas elaborate on what a
> > read-only parameter is? I have never worked with reporting software
> > before
> > where putting data in the heading was problem.
> > Thanks,
> > Gary
> >
> > "Lev Semenets [MSFT]" <levs@.microsoft.com> wrote in message
> > news:uvsl$ZVhEHA.2784@.TK2MSFTNGP09.phx.gbl...
> >> create read-only parameter with default value from query and then to use
> >> this parameter in the page header textbox.
> >>
> >> --
> >> This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> >>
> >> "Gary D." <Dean@.nospam.com> wrote in message
> >> news:%23F1%233OVhEHA.1768@.TK2MSFTNGP10.phx.gbl...
> >> > It is my understanding that data items can not exist in a header (or
> >> > footer). Yet in multi page reports it is often a requirement to
> >> > reprint
> > a
> >> > heading that has data in it. What is the best way to address this
> > issue?
> >> > Thanks,
> >> > Gary
> >> >
> >> >
> >>
> >>
> >
> >
>
>

Friday, February 17, 2012

Data handling in sysindexes table

Hi,
I require your help in understanding the way data is maintained in
sysindexes table, I have two doubts,
1) While creating a foreign key constraint for a table, new entry is made in
this table, after dropping this constraint, the entry added with indid equal
to 2 is not deleted from sysindexes table.
2) When we transfer the data from one file group to another, groupid field
value for
for indid equal to 2 still shows the old file group value.
Please execute the following sql statements to simulate the scenario I am
talking about.
create table Department
(DeptId int not null,
DeptName varchar(100))
go
insert into Department
values(1, 'One')
insert into Department
values(2, 'two')
insert into Department
values(3, 'three')
select * from sysindexes
where id = object_id('Department')
-- you will see one entry with indid equal to 0
alter table Department
add constraint PK_DeptId PRIMARY KEY (DeptId)
go
select * from sysindexes
where id = object_id('Department')
-- you will see one entry with indid equal to 1
create table Employee
(EmpId int not null,
EmpName varchar(100),
DeptId int not null)
go
select * from sysindexes
where id = object_id('Employee')
insert into employee
values(1, 'Emp1', 1)
insert into employee
values(2, 'Emp2', 2)
insert into employee
values(3, 'Emp3', 3)
-- you will see one entry with indid equal to 0
alter table Employee
add constraint PK_EmpId PRIMARY KEY (EmpId)
go
alter table Employee
add constraint FK_Emp_DeptId FOREIGN KEY (DeptId)
REFERENCES Department(DeptId)
go
select * from sysindexes
where id = object_id('Employee')
-- you will see two entries with indid values 1 and 2
alter table Employee
drop constraint FK_Emp_DeptId
go
DBCC dbreindex ('Employee', '', 50)
DBCC dbreindex ('Department', '', 50)
select * from sysindexes
where id = object_id('Employee')
-- still you will see those two entries, and indid 2 is not removed from
sysindexes table.
To change the file group, I follow the steps given below, after completing
these steps
groupid value with '2' in sysindexs table for employee object is not getting
updated to
the new file group id value.
1) We drop the employee table's clustered index and recreate clustered index
on the new file group, after this group id field in sysindexes table is
changed
to the new file group in employee table for the row where indid is 1.
2) We drop the foreign key constraint in employee table.
3) We drop the department table's clustered index and recreate clustered
index
on the new file group, after this group id field in sysindexes table is
changed
to the new file group in department table.
4) Foreign key constraint is created again on the employee table by
referring department
table.
5) Execute this statement, select * from sysindexes where id =
object_id('Employee')
6) Groupid field in sysindexes table for employee table against indid value
2 still
shows the old file group id.
This behaviour in sysindexes table is bit confusing, please help me out,
thank you.
Regards,
DevaI think the changes will get reflected when the Server feels that the
statisctics are out of date.
Try
EXEC sp_updatestats
before you check for the change. Its just a guess.
Let me know if this worked.|||Hi,
Data in sysindexes table is not updated even after running
EXEC sp_updatestats
statement, thank you.
Regards,
Deva|||Can you try
DBCC UPDATEUSAGE ('<DBNAME>','<TABLENAME>')
--
"Deva" wrote:

> Hi,
> Data in sysindexes table is not updated even after running
> EXEC sp_updatestats
> statement, thank you.
> Regards,
> Deva
>|||Hi,
Bad luck, even updateusage command does not refresh the data in sysindexes
table, thank you.
Regards,
Deva
"Omnibuzz" wrote:
> Can you try
> DBCC UPDATEUSAGE ('<DBNAME>','<TABLENAME>')
> --
>
>
> "Deva" wrote:
>|||Deva
sp_helpindex 'Employee'
sp_helpconstraint 'Employee'
Yep, it seems to be fixed in SQL Server 2005
select * from sys.indexes
where object_id= object_id('Employee')
Shows only one row
"Deva" <Deva@.discussions.microsoft.com> wrote in message
news:E25567E2-F79B-4516-AD31-6CDC58567F32@.microsoft.com...
> Hi,
> Bad luck, even updateusage command does not refresh the data in sysindexes
> table, thank you.
> Regards,
> Deva
>
> "Omnibuzz" wrote:
>|||1) This is most likely statistics created. What is the name of that "index"?
2) Since statistics doesn't store any pages, the file group is irrelevant. M
ost probably Ms decided
not to change this (dummy) value in case you move the physical table, since
the value should really
be NULL in the first place.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Deva" <Deva@.discussions.microsoft.com> wrote in message
news:E422EDEF-5DA1-4135-97EF-DCA8637E7B63@.microsoft.com...
> Hi,
> I require your help in understanding the way data is maintained in
> sysindexes table, I have two doubts,
> 1) While creating a foreign key constraint for a table, new entry is made
in
> this table, after dropping this constraint, the entry added with indid equ
al
> to 2 is not deleted from sysindexes table.
> 2) When we transfer the data from one file group to another, groupid field
> value for
> for indid equal to 2 still shows the old file group value.
> Please execute the following sql statements to simulate the scenario I am
> talking about.
> create table Department
> (DeptId int not null,
> DeptName varchar(100))
> go
> insert into Department
> values(1, 'One')
> insert into Department
> values(2, 'two')
> insert into Department
> values(3, 'three')
> select * from sysindexes
> where id = object_id('Department')
> -- you will see one entry with indid equal to 0
> alter table Department
> add constraint PK_DeptId PRIMARY KEY (DeptId)
> go
> select * from sysindexes
> where id = object_id('Department')
> -- you will see one entry with indid equal to 1
> create table Employee
> (EmpId int not null,
> EmpName varchar(100),
> DeptId int not null)
> go
> select * from sysindexes
> where id = object_id('Employee')
> insert into employee
> values(1, 'Emp1', 1)
> insert into employee
> values(2, 'Emp2', 2)
> insert into employee
> values(3, 'Emp3', 3)
> -- you will see one entry with indid equal to 0
> alter table Employee
> add constraint PK_EmpId PRIMARY KEY (EmpId)
> go
> alter table Employee
> add constraint FK_Emp_DeptId FOREIGN KEY (DeptId)
> REFERENCES Department(DeptId)
> go
> select * from sysindexes
> where id = object_id('Employee')
> -- you will see two entries with indid values 1 and 2
> alter table Employee
> drop constraint FK_Emp_DeptId
> go
> DBCC dbreindex ('Employee', '', 50)
> DBCC dbreindex ('Department', '', 50)
> select * from sysindexes
> where id = object_id('Employee')
> -- still you will see those two entries, and indid 2 is not removed from
> sysindexes table.
> To change the file group, I follow the steps given below, after completing
> these steps
> groupid value with '2' in sysindexs table for employee object is not getti
ng
> updated to
> the new file group id value.
> 1) We drop the employee table's clustered index and recreate clustered ind
ex
> on the new file group, after this group id field in sysindexes table is
> changed
> to the new file group in employee table for the row where indid is 1.
> 2) We drop the foreign key constraint in employee table.
> 3) We drop the department table's clustered index and recreate clustered
> index
> on the new file group, after this group id field in sysindexes table is
> changed
> to the new file group in department table.
> 4) Foreign key constraint is created again on the employee table by
> referring department
> table.
> 5) Execute this statement, select * from sysindexes where id =
> object_id('Employee')
> 6) Groupid field in sysindexes table for employee table against indid valu
e
> 2 still
> shows the old file group id.
> This behaviour in sysindexes table is bit confusing, please help me out,
> thank you.
> Regards,
> Deva|||On Tue, 9 May 2006 22:26:01 -0700, Deva wrote:

>Hi,
>I require your help in understanding the way data is maintained in
>sysindexes table, I have two doubts,
>1) While creating a foreign key constraint for a table, new entry is made i
n
>this table, after dropping this constraint, the entry added with indid equa
l
>to 2 is not deleted from sysindexes table.
>2) When we transfer the data from one file group to another, groupid field
>value for
>for indid equal to 2 still shows the old file group value.
(snip)
Hi Deva,
The extra row in sysindexes that you see is not for an index, but for
column statistics. If you look at the name column in the output from
SELECT * FROM sysindexes WHERE ...
you'll see that the name start with "_WA_Sys_". For experienced SQL
Server user, this is a clear indication that this is not a real index,
but an entry for column statistics.
I don't think it's documented anywhere, but a more reliable way to
seperate statistics entries from real indexes in sysindexes is to use
the status column:
SELECT *
FROM sysindexes
WHERE id = OBJECT_ID('Employee')
AND status & 64 = 0
Or, even better, don't query the system tables at all. Use the supported
stored procedures instead:
EXEC sp_helpindex 'Employee'
Hugo Kornelis, SQL Server MVP|||Hugo,

> AND status & 64 = 0
How about using INDEXPROPERTY() instead? ;-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Hugo Kornelis" <hugo@.perFact.REMOVETHIS.info.INVALID> wrote in message
news:9ga362h8at3nk05gmhtj2hnb5hqfq0sop4@.
4ax.com...
> On Tue, 9 May 2006 22:26:01 -0700, Deva wrote:
>
> (snip)
> Hi Deva,
> The extra row in sysindexes that you see is not for an index, but for
> column statistics. If you look at the name column in the output from
> SELECT * FROM sysindexes WHERE ...
> you'll see that the name start with "_WA_Sys_". For experienced SQL
> Server user, this is a clear indication that this is not a real index,
> but an entry for column statistics.
> I don't think it's documented anywhere, but a more reliable way to
> seperate statistics entries from real indexes in sysindexes is to use
> the status column:
> SELECT *
> FROM sysindexes
> WHERE id = OBJECT_ID('Employee')
> AND status & 64 = 0
> Or, even better, don't query the system tables at all. Use the supported
> stored procedures instead:
> EXEC sp_helpindex 'Employee'
> --
> Hugo Kornelis, SQL Server MVP|||On Wed, 10 May 2006 18:58:09 +0200, Tibor Karaszi wrote:

>Hugo,
>
>How about using INDEXPROPERTY() instead? ;-)
Hi Tibor,
Of course! Much better. (sound of hand slapping forehead)
That's what I get for giving up on BOL in frustration and simply
checking sp_helptext sp_helpindex...
Hugo Kornelis, SQL Server MVP