Showing posts with label group. Show all posts
Showing posts with label group. Show all posts

Wednesday, March 28, 2012

How to force unique entries in a linking table?

I have a table 'Group2Operation' that stores many to many relations
between the 'Group' table and the 'Operation' table (each group is has
permission to perform one or more of the available operations)

PROBLEM
=======
I need to prevent duplicate entries being created. e.g. lets say that
in the 'Group2Operation' table a record links the 'editor' group to
the 'publish' operation. Should I prevent an administrator creating a
duplicate of that record? (Otherwise deleting that permission will
have to be done twice or more for it to be effective)

SOLUTION?
=========
So far I've done this with a trigger:

CREATE TRIGGER Group2OperationDuplicates ON dbo.Group2Operation
FOR INSERT, UPDATE
AS UPDATE Group2Operation
SET NoDuplicate = CONVERT(nvarchar(10),GroupID) + OperationTag

The 'NoDuplicate' unique index column in the Group2Operation table
stores a concatenation of the unique group and operation identifiers.
So when an attempt is made to create a record, the trigger is fired.
If there is a duplicate, this will mean a duplicate entry in the
'NoDuplicate' column. As a result, the INSERT or UPDATE will fail and
the duplication will be prevented.

WHAT DO YOU THINK?
==================
What do you think? Am I going about this in the right way? Is a
trigger a good way to do this or should I rely on application logic to
prevent duplicates?

Any help appreciated by this db novice.
John GristConsider creating a PRIMARY KEY or UNIQUE constraint on the Group2Operation
table. This will ensure duplicate entries cannot be inserted. There is no
need to concatenate values or use a separate table since you can specify a
composite key:

ALTER TABLE Group2Operation
ADD CONSTRAINT PK_Group2Operation
PRIMARY KEY (GroupID, OperationTag)

BTW, it's a good practice to post DDL (create table) when posting questions
to this forum.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"grist2mill" <grist2mill@.excite.com> wrote in message
news:46e240e.0409030059.79f2f36d@.posting.google.co m...
>I have a table 'Group2Operation' that stores many to many relations
> between the 'Group' table and the 'Operation' table (each group is has
> permission to perform one or more of the available operations)
> PROBLEM
> =======
> I need to prevent duplicate entries being created. e.g. lets say that
> in the 'Group2Operation' table a record links the 'editor' group to
> the 'publish' operation. Should I prevent an administrator creating a
> duplicate of that record? (Otherwise deleting that permission will
> have to be done twice or more for it to be effective)
> SOLUTION?
> =========
> So far I've done this with a trigger:
> CREATE TRIGGER Group2OperationDuplicates ON dbo.Group2Operation
> FOR INSERT, UPDATE
> AS UPDATE Group2Operation
> SET NoDuplicate = CONVERT(nvarchar(10),GroupID) + OperationTag
> The 'NoDuplicate' unique index column in the Group2Operation table
> stores a concatenation of the unique group and operation identifiers.
> So when an attempt is made to create a record, the trigger is fired.
> If there is a duplicate, this will mean a duplicate entry in the
> 'NoDuplicate' column. As a result, the INSERT or UPDATE will fail and
> the duplication will be prevented.
> WHAT DO YOU THINK?
> ==================
> What do you think? Am I going about this in the right way? Is a
> trigger a good way to do this or should I rely on application logic to
> prevent duplicates?
> Any help appreciated by this db novice.
> John Grist|||That looks much better. I though there ought to be a better way.
Many thanks for your help
John

"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message news:<uh_Zc.14996$lu3.12768@.newssvr24.news.prodigy.com>...
> Consider creating a PRIMARY KEY or UNIQUE constraint on the Group2Operation
> table. This will ensure duplicate entries cannot be inserted. There is no
> need to concatenate values or use a separate table since you can specify a
> composite key:
> ALTER TABLE Group2Operation
> ADD CONSTRAINT PK_Group2Operation
> PRIMARY KEY (GroupID, OperationTag)
> BTW, it's a good practice to post DDL (create table) when posting questions
> to this forum.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "grist2mill" <grist2mill@.excite.com> wrote in message
> news:46e240e.0409030059.79f2f36d@.posting.google.co m...
> >I have a table 'Group2Operation' that stores many to many relations
> > between the 'Group' table and the 'Operation' table (each group is has
> > permission to perform one or more of the available operations)
> > PROBLEM
> > =======
> > I need to prevent duplicate entries being created. e.g. lets say that
> > in the 'Group2Operation' table a record links the 'editor' group to
> > the 'publish' operation. Should I prevent an administrator creating a
> > duplicate of that record? (Otherwise deleting that permission will
> > have to be done twice or more for it to be effective)
> > SOLUTION?
> > =========
> > So far I've done this with a trigger:
> > CREATE TRIGGER Group2OperationDuplicates ON dbo.Group2Operation
> > FOR INSERT, UPDATE
> > AS UPDATE Group2Operation
> > SET NoDuplicate = CONVERT(nvarchar(10),GroupID) + OperationTag
> > The 'NoDuplicate' unique index column in the Group2Operation table
> > stores a concatenation of the unique group and operation identifiers.
> > So when an attempt is made to create a record, the trigger is fired.
> > If there is a duplicate, this will mean a duplicate entry in the
> > 'NoDuplicate' column. As a result, the INSERT or UPDATE will fail and
> > the duplication will be prevented.
> > WHAT DO YOU THINK?
> > ==================
> > What do you think? Am I going about this in the right way? Is a
> > trigger a good way to do this or should I rely on application logic to
> > prevent duplicates?
> > Any help appreciated by this db novice.
> > John Grist

Monday, March 26, 2012

How to force a page break on a multi-column report ?

When I use the PageBreakAtEnd on the table or on a group in the table, all it does is create a new column of the column report.

I'd want it to start a new page, how can I do this ? Should I work around this issue using code ?

Background: What I need to achieve is a report with 2 columns where the list of products in category 1 are listed in the left column and then snake to the 2nd column on the same page, then to column 1 on page 2, column 2 on page 2, etc...

When it comes to category 2, it should start a fresh new page regardless of whether the previous product was rendered in column 1 or column 2.

I get the snaking to work using the "Columns" property of the report Body. However page breaks do not start a new page, they just start a new column.

What if you created an outer group which evaluated the same expression, and put the page break on that group instead? Would that work for you?|||

Hi Alan,

If u want page break after specifi records on report u can try by modifying the(.rdl) file which is XML and set the tag property as specific inches might work for u.For that u have to set the tag value 2 in or any 'x' in where tag name is 'InteractiveHeight'.

(<InteractiveHeight>11in</InteractiveHeight>)

I hope this'll help u for forcing the page break.

Regards,

Vikas

sql

How to fit table on one page

Hello, I have a report that displays about 200 data records. There is no any
group or subtotal in the report, but just plain data. It is built in a
table. The report always generates two pages when it is ran, even though I
checked "fit table on one page if possible" box on the properties of the
table. How can I set up the report to display the 200 records on one page?
Thanks in advance!Hi Jean,
You can change the Page Height property in the Report Properies dialogue to
a larger number to fit the rows. This is true if you are rendering the
report in HTML.
--
Rodney Landrum - Author, "Pro SQL Server Reporting Services" (Apress)
(http://www.apress.com/book/bookDisplay.html?bID=365)
"Jean" <Jean@.discussions.microsoft.com> wrote in message
news:F077EAB2-1B32-49FD-A81F-098E5B37034D@.microsoft.com...
> Hello, I have a report that displays about 200 data records. There is no
> any
> group or subtotal in the report, but just plain data. It is built in a
> table. The report always generates two pages when it is ran, even though I
> checked "fit table on one page if possible" box on the properties of the
> table. How can I set up the report to display the 200 records on one page?
> Thanks in advance!
>|||Hi Hean,
You can increase the size of your Page Height Property in Report
Properties/Layout tab. This should work if you are rendering in HTML.
--
Rodney Landrum
Author, "Pro SQL Server Reporting Services" (Apress)
http://www.apress.com
"Jean" <Jean@.discussions.microsoft.com> wrote in message
news:F077EAB2-1B32-49FD-A81F-098E5B37034D@.microsoft.com...
> Hello, I have a report that displays about 200 data records. There is no
> any
> group or subtotal in the report, but just plain data. It is built in a
> table. The report always generates two pages when it is ran, even though I
> checked "fit table on one page if possible" box on the properties of the
> table. How can I set up the report to display the 200 records on one page?
> Thanks in advance!
>|||Sorry, I meant Jean. :)
Rodney
"Jean" <Jean@.discussions.microsoft.com> wrote in message
news:F077EAB2-1B32-49FD-A81F-098E5B37034D@.microsoft.com...
> Hello, I have a report that displays about 200 data records. There is no
> any
> group or subtotal in the report, but just plain data. It is built in a
> table. The report always generates two pages when it is ran, even though I
> checked "fit table on one page if possible" box on the properties of the
> table. How can I set up the report to display the 200 records on one page?
> Thanks in advance!
>|||Rodney,
It works! Thanks a lot!
Jean
"Rodney Landrum" wrote:
> Sorry, I meant Jean. :)
> Rodney
> "Jean" <Jean@.discussions.microsoft.com> wrote in message
> news:F077EAB2-1B32-49FD-A81F-098E5B37034D@.microsoft.com...
> > Hello, I have a report that displays about 200 data records. There is no
> > any
> > group or subtotal in the report, but just plain data. It is built in a
> > table. The report always generates two pages when it is ran, even though I
> > checked "fit table on one page if possible" box on the properties of the
> > table. How can I set up the report to display the 200 records on one page?
> >
> > Thanks in advance!
> >
>
>sql

Friday, March 23, 2012

how to find which object belongs to which File group

Hi
We have a DB in which we have created two file groups. Both are currently
Primary file group. what is the best way to find out which objects are in
which file group?
Thanks,
This doesn't make sense. "Both are currently Primary file group." Only one
filegroup can be the primary filegroup.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada tom@.cips.ca
www.pinpub.com
"Moh" <mabbas@.Pier1.com> wrote in message
news:B93809BB-695B-4EED-9CE0-B3154B7D8301@.microsoft.com...
> Hi
> We have a DB in which we have created two file groups. Both are currently
> Primary file group. what is the best way to find out which objects are in
> which file group?
> Thanks,
>
|||I can mail you screen shot of EM where two files are listed as primary file
groups.
Moh
"Tom Moreau" wrote:

> This doesn't make sense. "Both are currently Primary file group." Only one
> filegroup can be the primary filegroup.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada tom@.cips.ca
> www.pinpub.com
> "Moh" <mabbas@.Pier1.com> wrote in message
> news:B93809BB-695B-4EED-9CE0-B3154B7D8301@.microsoft.com...
>
>
|||That's not what you said. You said "we have created two file groups". Now,
you're saying you created two files. Which is it?
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada tom@.cips.ca
www.pinpub.com
"Moh" <mabbas@.Pier1.com> wrote in message
news:A0603CAB-EDF1-46BF-B449-D989432DF7DF@.microsoft.com...[vbcol=seagreen]
>I can mail you screen shot of EM where two files are listed as primary file
> groups.
> Moh
> "Tom Moreau" wrote:
|||By the way for your knowledge, you can have more than one files belongs to a
File group(Primary FG or any other). you can not have one file belongs to
more than one FG.
Does that mamke sense?
thx,
Moh
Sr DBA
Pier 1 Imports
mabbas@.Pier1.com
"Tom Moreau" wrote:

> This doesn't make sense. "Both are currently Primary file group." Only one
> filegroup can be the primary filegroup.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada tom@.cips.ca
> www.pinpub.com
> "Moh" <mabbas@.Pier1.com> wrote in message
> news:B93809BB-695B-4EED-9CE0-B3154B7D8301@.microsoft.com...
>
>
|||I'm already aware of that. So, what exactly is the problem?
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada tom@.cips.ca
www.pinpub.com
"Moh" <mabbas@.Pier1.com> wrote in message
news:D6BCED88-53DB-4DA8-BC41-00E355065EF0@.microsoft.com...[vbcol=seagreen]
> By the way for your knowledge, you can have more than one files belongs to
> a
> File group(Primary FG or any other). you can not have one file belongs to
> more than one FG.
> Does that mamke sense?
> thx,
> Moh
> --
> Sr DBA
> Pier 1 Imports
> mabbas@.Pier1.com
>
> "Tom Moreau" wrote:
|||a filegroup is composed of one or more files
Objects are placed on filegroups and not files
If you wanted to know on which filegroup an object is placed, use sp_help
@.objectname
or the undocumented sp_objectfilegroup @.objid
If you wanted to know the list of all objects that belong to a filegroup
you can query sysindexes and group by the result by groupid
Med Bouchenafa
"Moh" <mabbas@.Pier1.com> a crit dans le message de news:
B93809BB-695B-4EED-9CE0-B3154B7D8301@.microsoft.com...
> Hi
> We have a DB in which we have created two file groups. Both are currently
> Primary file group. what is the best way to find out which objects are in
> which file group?
> Thanks,
>
|||Dear M Abbas,
From your 3 posts in this Response, it is clear that you need to improve in
following areas:
1. English Language Skills: There are both grammatical as well as spelling
mistakes in your posts. Example of Grammatical Mistake: ‘Both are currently
Primary file group’. Example of Spelling Mistake: ‘….mamke sense’.
2. Behavioural Skills: Tom Moreau didn’t make any wrong statements. It is
you who made wrong statement in the 1st post by saying ‘…we have created two
file groups. Both are currently Primary file group’. Still, you have
expressed anger in your 3rd post.
3. SQL Server Skills.
Remember, that the first person to benefit from these improvements will be
you. So choice is yours.
"Moh" wrote:
[vbcol=seagreen]
> By the way for your knowledge, you can have more than one files belongs to a
> File group(Primary FG or any other). you can not have one file belongs to
> more than one FG.
> Does that mamke sense?
> thx,
> Moh
> --
> Sr DBA
> Pier 1 Imports
> mabbas@.Pier1.com
>
> "Tom Moreau" wrote:
sql

how to find which object belongs to which File group

Hi
We have a DB in which we have created two file groups. Both are currently
Primary file group. what is the best way to find out which objects are in
which file group?
Thanks,This doesn't make sense. "Both are currently Primary file group." Only one
filegroup can be the primary filegroup.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada tom@.cips.ca
www.pinpub.com
"Moh" <mabbas@.Pier1.com> wrote in message
news:B93809BB-695B-4EED-9CE0-B3154B7D8301@.microsoft.com...
> Hi
> We have a DB in which we have created two file groups. Both are currently
> Primary file group. what is the best way to find out which objects are in
> which file group?
> Thanks,
>|||I can mail you screen shot of EM where two files are listed as primary file
groups.
Moh
"Tom Moreau" wrote:

> This doesn't make sense. "Both are currently Primary file group." Only on
e
> filegroup can be the primary filegroup.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada tom@.cips.ca
> www.pinpub.com
> "Moh" <mabbas@.Pier1.com> wrote in message
> news:B93809BB-695B-4EED-9CE0-B3154B7D8301@.microsoft.com...
>
>|||That's not what you said. You said "we have created two file groups". Now,
you're saying you created two files. Which is it?
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada tom@.cips.ca
www.pinpub.com
"Moh" <mabbas@.Pier1.com> wrote in message
news:A0603CAB-EDF1-46BF-B449-D989432DF7DF@.microsoft.com...[vbcol=seagreen]
>I can mail you screen shot of EM where two files are listed as primary file
> groups.
> Moh
> "Tom Moreau" wrote:
>|||By the way for your knowledge, you can have more than one files belongs to a
File group(Primary FG or any other). you can not have one file belongs to
more than one FG.
Does that mamke sense?
thx,
Moh
--
Sr DBA
Pier 1 Imports
mabbas@.Pier1.com
"Tom Moreau" wrote:

> This doesn't make sense. "Both are currently Primary file group." Only on
e
> filegroup can be the primary filegroup.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada tom@.cips.ca
> www.pinpub.com
> "Moh" <mabbas@.Pier1.com> wrote in message
> news:B93809BB-695B-4EED-9CE0-B3154B7D8301@.microsoft.com...
>
>|||I'm already aware of that. So, what exactly is the problem?
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada tom@.cips.ca
www.pinpub.com
"Moh" <mabbas@.Pier1.com> wrote in message
news:D6BCED88-53DB-4DA8-BC41-00E355065EF0@.microsoft.com...[vbcol=seagreen]
> By the way for your knowledge, you can have more than one files belongs to
> a
> File group(Primary FG or any other). you can not have one file belongs to
> more than one FG.
> Does that mamke sense?
> thx,
> Moh
> --
> Sr DBA
> Pier 1 Imports
> mabbas@.Pier1.com
>
> "Tom Moreau" wrote:
>|||a filegroup is composed of one or more files
Objects are placed on filegroups and not files
If you wanted to know on which filegroup an object is placed, use sp_help
@.objectname
or the undocumented sp_objectfilegroup @.objid
If you wanted to know the list of all objects that belong to a filegroup
you can query sysindexes and group by the result by groupid
Med Bouchenafa
"Moh" <mabbas@.Pier1.com> a crit dans le message de news:
B93809BB-695B-4EED-9CE0-B3154B7D8301@.microsoft.com...
> Hi
> We have a DB in which we have created two file groups. Both are currently
> Primary file group. what is the best way to find out which objects are in
> which file group?
> Thanks,
>|||Dear M Abbas,
From your 3 posts in this Response, it is clear that you need to improve in
following areas:
1. English Language Skills: There are both grammatical as well as spelling
mistakes in your posts. Example of Grammatical Mistake: ‘Both are currentl
y
Primary file group’. Example of Spelling Mistake: ‘….mamke sense’.
2. Behavioural Skills: Tom Moreau didn’t make any wrong statements. It is
you who made wrong statement in the 1st post by saying ‘…we have created
two
file groups. Both are currently Primary file group’. Still, you have
expressed anger in your 3rd post.
3. SQL Server Skills.
Remember, that the first person to benefit from these improvements will be
you. So choice is yours.
"Moh" wrote:
[vbcol=seagreen]
> By the way for your knowledge, you can have more than one files belongs to
a
> File group(Primary FG or any other). you can not have one file belongs to
> more than one FG.
> Does that mamke sense?
> thx,
> Moh
> --
> Sr DBA
> Pier 1 Imports
> mabbas@.Pier1.com
>
> "Tom Moreau" wrote:
>

how to find which object belongs to which File group

Hi
We have a DB in which we have created two file groups. Both are currently
Primary file group. what is the best way to find out which objects are in
which file group?
Thanks,This doesn't make sense. "Both are currently Primary file group." Only one
filegroup can be the primary filegroup.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada tom@.cips.ca
www.pinpub.com
"Moh" <mabbas@.Pier1.com> wrote in message
news:B93809BB-695B-4EED-9CE0-B3154B7D8301@.microsoft.com...
> Hi
> We have a DB in which we have created two file groups. Both are currently
> Primary file group. what is the best way to find out which objects are in
> which file group?
> Thanks,
>|||I can mail you screen shot of EM where two files are listed as primary file
groups.
Moh
"Tom Moreau" wrote:
> This doesn't make sense. "Both are currently Primary file group." Only one
> filegroup can be the primary filegroup.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada tom@.cips.ca
> www.pinpub.com
> "Moh" <mabbas@.Pier1.com> wrote in message
> news:B93809BB-695B-4EED-9CE0-B3154B7D8301@.microsoft.com...
> > Hi
> > We have a DB in which we have created two file groups. Both are currently
> > Primary file group. what is the best way to find out which objects are in
> > which file group?
> >
> > Thanks,
> >
> >
>
>|||That's not what you said. You said "we have created two file groups". Now,
you're saying you created two files. Which is it?
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada tom@.cips.ca
www.pinpub.com
"Moh" <mabbas@.Pier1.com> wrote in message
news:A0603CAB-EDF1-46BF-B449-D989432DF7DF@.microsoft.com...
>I can mail you screen shot of EM where two files are listed as primary file
> groups.
> Moh
> "Tom Moreau" wrote:
>> This doesn't make sense. "Both are currently Primary file group." Only
>> one
>> filegroup can be the primary filegroup.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> SQL Server MVP
>> Columnist, SQL Server Professional
>> Toronto, ON Canada tom@.cips.ca
>> www.pinpub.com
>> "Moh" <mabbas@.Pier1.com> wrote in message
>> news:B93809BB-695B-4EED-9CE0-B3154B7D8301@.microsoft.com...
>> > Hi
>> > We have a DB in which we have created two file groups. Both are
>> > currently
>> > Primary file group. what is the best way to find out which objects are
>> > in
>> > which file group?
>> >
>> > Thanks,
>> >
>> >
>>|||By the way for your knowledge, you can have more than one files belongs to a
File group(Primary FG or any other). you can not have one file belongs to
more than one FG.
Does that mamke sense?
thx,
Moh
--
Sr DBA
Pier 1 Imports
mabbas@.Pier1.com
"Tom Moreau" wrote:
> This doesn't make sense. "Both are currently Primary file group." Only one
> filegroup can be the primary filegroup.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada tom@.cips.ca
> www.pinpub.com
> "Moh" <mabbas@.Pier1.com> wrote in message
> news:B93809BB-695B-4EED-9CE0-B3154B7D8301@.microsoft.com...
> > Hi
> > We have a DB in which we have created two file groups. Both are currently
> > Primary file group. what is the best way to find out which objects are in
> > which file group?
> >
> > Thanks,
> >
> >
>
>|||I'm already aware of that. So, what exactly is the problem?
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada tom@.cips.ca
www.pinpub.com
"Moh" <mabbas@.Pier1.com> wrote in message
news:D6BCED88-53DB-4DA8-BC41-00E355065EF0@.microsoft.com...
> By the way for your knowledge, you can have more than one files belongs to
> a
> File group(Primary FG or any other). you can not have one file belongs to
> more than one FG.
> Does that mamke sense?
> thx,
> Moh
> --
> Sr DBA
> Pier 1 Imports
> mabbas@.Pier1.com
>
> "Tom Moreau" wrote:
>> This doesn't make sense. "Both are currently Primary file group." Only
>> one
>> filegroup can be the primary filegroup.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> SQL Server MVP
>> Columnist, SQL Server Professional
>> Toronto, ON Canada tom@.cips.ca
>> www.pinpub.com
>> "Moh" <mabbas@.Pier1.com> wrote in message
>> news:B93809BB-695B-4EED-9CE0-B3154B7D8301@.microsoft.com...
>> > Hi
>> > We have a DB in which we have created two file groups. Both are
>> > currently
>> > Primary file group. what is the best way to find out which objects are
>> > in
>> > which file group?
>> >
>> > Thanks,
>> >
>> >
>>|||a filegroup is composed of one or more files
Objects are placed on filegroups and not files
If you wanted to know on which filegroup an object is placed, use sp_help
@.objectname
or the undocumented sp_objectfilegroup @.objid
If you wanted to know the list of all objects that belong to a filegroup
you can query sysindexes and group by the result by groupid
Med Bouchenafa
"Moh" <mabbas@.Pier1.com> a écrit dans le message de news:
B93809BB-695B-4EED-9CE0-B3154B7D8301@.microsoft.com...
> Hi
> We have a DB in which we have created two file groups. Both are currently
> Primary file group. what is the best way to find out which objects are in
> which file group?
> Thanks,
>|||Dear M Abbas,
From your 3 posts in this Response, it is clear that you need to improve in
following areas:
1. English Language Skills: There are both grammatical as well as spelling
mistakes in your posts. Example of Grammatical Mistake: â'Both are currently
Primary file groupâ'. Example of Spelling Mistake: â'â?¦.mamke senseâ'.
2. Behavioural Skills: Tom Moreau didnâ't make any wrong statements. It is
you who made wrong statement in the 1st post by saying â'â?¦we have created two
file groups. Both are currently Primary file groupâ'. Still, you have
expressed anger in your 3rd post.
3. SQL Server Skills.
Remember, that the first person to benefit from these improvements will be
you. So choice is yours.
"Moh" wrote:
> By the way for your knowledge, you can have more than one files belongs to a
> File group(Primary FG or any other). you can not have one file belongs to
> more than one FG.
> Does that mamke sense?
> thx,
> Moh
> --
> Sr DBA
> Pier 1 Imports
> mabbas@.Pier1.com
>
> "Tom Moreau" wrote:
> > This doesn't make sense. "Both are currently Primary file group." Only one
> > filegroup can be the primary filegroup.
> >
> > --
> > Tom
> >
> > ----
> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > SQL Server MVP
> > Columnist, SQL Server Professional
> > Toronto, ON Canada tom@.cips.ca
> > www.pinpub.com
> >
> > "Moh" <mabbas@.Pier1.com> wrote in message
> > news:B93809BB-695B-4EED-9CE0-B3154B7D8301@.microsoft.com...
> > > Hi
> > > We have a DB in which we have created two file groups. Both are currently
> > > Primary file group. what is the best way to find out which objects are in
> > > which file group?
> > >
> > > Thanks,

How to find what Tables and Indexes are on what filegroup

Hello,
Is there a query that can be written to determine what Tables and indexes
are on a particular file group?
Thanks
Anubis.sp_help 'YourTable' will return the filegroup in one of the
resultsets that is returned. There are also some
undocumented ways such as:
sp_objectfilegroup @.objid
or querying the system tables...something like:
SELECT so.name, sfg.groupname
FROM sysobjects so
INNER JOIN sysindexes si
ON so.id=si.id
INNER JOIN sysfilegroups sfg
ON si.groupid=sfg.groupid
WHERE si.indid < 2
AND so.type = 'U'
-Sue
On Tue, 14 Jun 2005 12:17:47 +1000, "Anubis"
<anubis@.iwwd.com> wrote:
>Hello,
>Is there a query that can be written to determine what Tables and indexes
>are on a particular file group?
>Thanks
>Anubis.
>|||This is a multi-part message in MIME format.
--010807000500020704010007
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Depends on what info you want to find out. But it will be some
variation on this:
select object_name(i.[id]) as tablename, i.*
from dbo.sysindexes as i
inner join dbo.sysfilegroups as g on g.groupid = i.groupid
where g.groupname = 'PRIMARY'
If it's just names you're after then the column list in the select
statement will be something like "select object_name(i.[id]) as
tablename, i.[name] as indexname ..." but there's heaps of other info
you can find out from dbo.sysindexes, like the index type (clustered,
nonclustered, heap, LOB data - all from the indid), etc.
--
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
Anubis wrote:
>Hello,
>Is there a query that can be written to determine what Tables and indexes
>are on a particular file group?
>Thanks
>Anubis.
>
>
--010807000500020704010007
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Depends on what info you want to find out. But it will be some
variation on this:<br>
</tt>
<blockquote><tt>select object_name(i.[id]) as tablename, i.*</tt><br>
<tt>from dbo.sysindexes as i</tt><br>
<tt> inner join dbo.sysfilegroups as g on g.groupid = i.groupid</tt><br>
<tt>where g.groupname = 'PRIMARY'<br>
</tt></blockquote>
<tt>If it's just names you're after then the column list in the select
statement will be something like "select object_name(i.[id]) as
tablename, i.[name] as indexname ..." but there's heaps of other info
you can find out from dbo.sysindexes, like the index type (clustered,
nonclustered, heap, LOB data - all from the indid), etc.</tt><br>
<div class="moz-signature">
<title></title>
<meta http-equiv="Content-Type" content="text/html; ">
<p><span lang="en-au"><font face="Tahoma" size="2">--<br>
</font> </span><b><span lang="en-au"><font face="Tahoma" size="2">mike
hodgson</font></span></b><span lang="en-au"> <font face="Tahoma"
size="2">|</font><i><font face="Tahoma"> </font><font face="Tahoma"
size="2"> database administrator</font></i><font face="Tahoma" size="2">
| mallesons</font><font face="Tahoma"> </font><font face="Tahoma"
size="2">stephen</font><font face="Tahoma"> </font><font face="Tahoma"
size="2"> jaques</font><font face="Tahoma"><br>
</font><b><font face="Tahoma" size="2">T</font></b><font face="Tahoma"
size="2"> +61 (2) 9296 3668 |</font><b><font face="Tahoma"> </font><font
face="Tahoma" size="2"> F</font></b><font face="Tahoma" size="2"> +61
(2) 9296 3885 |</font><b><font face="Tahoma"> </font><font
face="Tahoma" size="2">M</font></b><font face="Tahoma" size="2"> +61
(408) 675 907</font><br>
<b><font face="Tahoma" size="2">E</font></b><font face="Tahoma" size="2">
<a href="http://links.10026.com/?link=mailto:mike.hodgson@.mallesons.nospam.com">
mailto:mike.hodgson@.mallesons.nospam.com</a> |</font><b><font
face="Tahoma"> </font><font face="Tahoma" size="2">W</font></b><font
face="Tahoma" size="2"> <a href="http://links.10026.com/?link=/">http://www.mallesons.com">
http://www.mallesons.com</a></font></span> </p>
</div>
<br>
<br>
Anubis wrote:
<blockquote cite="miduyBFlhIcFHA.1148@.tk2msftngp13.phx.gbl" type="cite">
<pre wrap="">Hello,
Is there a query that can be written to determine what Tables and indexes
are on a particular file group?
Thanks
Anubis.
</pre>
</blockquote>
</body>
</html>
--010807000500020704010007--|||I wrote a script that does exactly what you ask (and more)
http://education.sqlfarms.com/ShowPost.aspx?PostID=48
for your convenient download. Enjoy.
The script lists all the tables and indexes filgroup, as well as provides
other information.
--
Omri Bahat
SQL Farms Solutions
www.sqlfarms.com

Monday, March 19, 2012

how to find out who are in BUILTIN/Administrators Group?

sql2k, nt5
Does anyone know how to find out who are the members in
BUILTIN/Administrators group in SQL Server. (when I'm not in a NT domain
admin group and can't see nt account info from the NT side).
thank you.
The BUILTIN/Administrators group maps to the Windows Local administrators
group. If you can't see who's in the Windows group, you can't find out who's
in BUILTIN/Administrators.
Jacco Schalkwijk
SQL Server MVP
"Steve Lin" <lins@.nospam.portptld.com> wrote in message
news:%23W8uAl7JEHA.3980@.TK2MSFTNGP10.phx.gbl...
> sql2k, nt5
> Does anyone know how to find out who are the members in
> BUILTIN/Administrators group in SQL Server. (when I'm not in a NT domain
> admin group and can't see nt account info from the NT side).
> thank you.
>
|||You can try
exec master..xp_logininfo 'BUILTIN\Administrators','members'
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Steve Lin" <lins@.nospam.portptld.com> wrote in message
news:%23W8uAl7JEHA.3980@.TK2MSFTNGP10.phx.gbl...
> sql2k, nt5
> Does anyone know how to find out who are the members in
> BUILTIN/Administrators group in SQL Server. (when I'm not in a NT domain
> admin group and can't see nt account info from the NT side).
> thank you.
>
|||that's very helpful. thank you!!!
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:ObGoTa8JEHA.644@.tk2msftngp13.phx.gbl...
> You can try
> exec master..xp_logininfo 'BUILTIN\Administrators','members'
> --
> HTH
> Jasper Smith (SQL Server MVP)
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
>
> "Steve Lin" <lins@.nospam.portptld.com> wrote in message
> news:%23W8uAl7JEHA.3980@.TK2MSFTNGP10.phx.gbl...
>

how to find out who are in BUILTIN/Administrators Group?

sql2k, nt5
Does anyone know how to find out who are the members in
BUILTIN/Administrators group in SQL Server. (when I'm not in a NT domain
admin group and can't see nt account info from the NT side).
thank you.The BUILTIN/Administrators group maps to the Windows Local administrators
group. If you can't see who's in the Windows group, you can't find out who's
in BUILTIN/Administrators.
Jacco Schalkwijk
SQL Server MVP
"Steve Lin" <lins@.nospam.portptld.com> wrote in message
news:%23W8uAl7JEHA.3980@.TK2MSFTNGP10.phx.gbl...
> sql2k, nt5
> Does anyone know how to find out who are the members in
> BUILTIN/Administrators group in SQL Server. (when I'm not in a NT domain
> admin group and can't see nt account info from the NT side).
> thank you.
>|||You can try
exec master..xp_logininfo 'BUILTIN\Administrators','members'
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Steve Lin" <lins@.nospam.portptld.com> wrote in message
news:%23W8uAl7JEHA.3980@.TK2MSFTNGP10.phx.gbl...
> sql2k, nt5
> Does anyone know how to find out who are the members in
> BUILTIN/Administrators group in SQL Server. (when I'm not in a NT domain
> admin group and can't see nt account info from the NT side).
> thank you.
>|||that's very helpful. thank you!!!
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:ObGoTa8JEHA.644@.tk2msftngp13.phx.gbl...
> You can try
> exec master..xp_logininfo 'BUILTIN\Administrators','members'
> --
> HTH
> Jasper Smith (SQL Server MVP)
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
>
> "Steve Lin" <lins@.nospam.portptld.com> wrote in message
> news:%23W8uAl7JEHA.3980@.TK2MSFTNGP10.phx.gbl...
>

Monday, March 12, 2012

how to find out who are in BUILTIN/Administrators Group?

sql2k, nt5
Does anyone know how to find out who are the members in
BUILTIN/Administrators group in SQL Server. (when I'm not in a NT domain
admin group and can't see nt account info from the NT side).
thank you.The BUILTIN/Administrators group maps to the Windows Local administrators
group. If you can't see who's in the Windows group, you can't find out who's
in BUILTIN/Administrators.
--
Jacco Schalkwijk
SQL Server MVP
"Steve Lin" <lins@.nospam.portptld.com> wrote in message
news:%23W8uAl7JEHA.3980@.TK2MSFTNGP10.phx.gbl...
> sql2k, nt5
> Does anyone know how to find out who are the members in
> BUILTIN/Administrators group in SQL Server. (when I'm not in a NT domain
> admin group and can't see nt account info from the NT side).
> thank you.
>|||You can try
exec master..xp_logininfo 'BUILTIN\Administrators','members'
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Steve Lin" <lins@.nospam.portptld.com> wrote in message
news:%23W8uAl7JEHA.3980@.TK2MSFTNGP10.phx.gbl...
> sql2k, nt5
> Does anyone know how to find out who are the members in
> BUILTIN/Administrators group in SQL Server. (when I'm not in a NT domain
> admin group and can't see nt account info from the NT side).
> thank you.
>|||that's very helpful. thank you!!!
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:ObGoTa8JEHA.644@.tk2msftngp13.phx.gbl...
> You can try
> exec master..xp_logininfo 'BUILTIN\Administrators','members'
> --
> HTH
> Jasper Smith (SQL Server MVP)
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
>
> "Steve Lin" <lins@.nospam.portptld.com> wrote in message
> news:%23W8uAl7JEHA.3980@.TK2MSFTNGP10.phx.gbl...
> > sql2k, nt5
> >
> > Does anyone know how to find out who are the members in
> > BUILTIN/Administrators group in SQL Server. (when I'm not in a NT domain
> > admin group and can't see nt account info from the NT side).
> >
> > thank you.
> >
> >
>

Wednesday, March 7, 2012

How to find group user login Name

Our system administrator set up an NT server group in order to allow
our users to login to our application via https to our sql server.
The group appears as a User in SQL Server when you look at it in
Enterprise Manager. That said, I can not see the users associated
with the group from Enterprise Manager, but know they can login to the
database.
The problem is this. When we login via the web we get access to the
database without problem, but when you look at the current_user what
you see is the login Name the user entered and NOT the name of the
group/User. That is to say, I can see a UserID which is not listed as
a User in SQL Server and can't see the name of the group, which is
listed as a user in SQL Server.
I need to know who's logging in order to direct them to the
appropriate web page via their role. Before the admin set up the
group, I was using sp_helpuser to get the role, but then again I had
the userID to do this.
The question I have now, is there any way to see what the
group/user is who logged in i.e. the goup listed as the User in
Enterprise Manager? Otherwise I have to build a table of userIDs and
their group/User name, which seems to defeat the purpose of having he
server authenticate users.

Thanks,
Tom"Tom Loach" <tcl4p@.virginia.edu> wrote in message
news:o7vttvktkbdbib39pqklga3f8s9lgdsksc@.4ax.com...
> Our system administrator set up an NT server group in order to allow
> our users to login to our application via https to our sql server.
> The group appears as a User in SQL Server when you look at it in
> Enterprise Manager. That said, I can not see the users associated
> with the group from Enterprise Manager, but know they can login to the
> database.
> The problem is this. When we login via the web we get access to the
> database without problem, but when you look at the current_user what
> you see is the login Name the user entered and NOT the name of the
> group/User. That is to say, I can see a UserID which is not listed as
> a User in SQL Server and can't see the name of the group, which is
> listed as a user in SQL Server.
> I need to know who's logging in order to direct them to the
> appropriate web page via their role. Before the admin set up the
> group, I was using sp_helpuser to get the role, but then again I had
> the userID to do this.
> The question I have now, is there any way to see what the
> group/user is who logged in i.e. the goup listed as the User in
> Enterprise Manager? Otherwise I have to build a table of userIDs and
> their group/User name, which seems to defeat the purpose of having he
> server authenticate users.
> Thanks,
> Tom

I'm not sure I understand your setup completely, but if you use CURRENT_USER
you will see the user name in the current database, not the login name. If
you use SYSTEM_USER instead, you should see the user's login - does this
give the result you expect?

If not, then perhaps you could clarify the sequence of events used to set up
the group, espeically the difference between a server login and a database
user - this is what's not entirely clear from your post above. If you can
provide the actual SQL commands used to set up server access and permissions
for the Windows group, that would be the least ambiguous description,
although of course you may well have done it through Enterprise Manager
instead.

Simon|||Simon,
thanks for your suggestion, but alas it did not work. Iam sorrry
I was not able to make the situation more clear, but perhaps another
try.
We have a group account set up, which if you look at in Enterprise
manager appears as a User i.e. a_Group. Obviously, since this is a
group account it is comprised of multiple users who need access to SQL
Server. The problem we're having is, if you login to the system and
if I run a stored procedure that returns the Current_User, what I get
is not the name of the User i.e. a_Group that appears in Enterprise
Manager, but the UserID i.e. h3tcl that was used to login to the
Windows server.
When I tried to exec sp_helpuser using Current_User I get an error
since SQL Server does not know who the user is (it sees h3tcl). If I
exec sp_helpuser and enter the user name (a_Group) found in
Enterprise manager sp_helpuser works fine and returns the appropriate
data from SQL Server.
So I'm back to the problem is how and where do I look for the group
name? If you have any other ideas I'm more than open. Thanks again
for your input.

Regards,
Tom

On Tue, 16 Dec 2003 16:44:21 +0100, "Simon Hayes" <sql@.hayes.ch>
wrote:

>"Tom Loach" <tcl4p@.virginia.edu> wrote in message
>news:o7vttvktkbdbib39pqklga3f8s9lgdsksc@.4ax.com...
>> Our system administrator set up an NT server group in order to allow
>> our users to login to our application via https to our sql server.
>> The group appears as a User in SQL Server when you look at it in
>> Enterprise Manager. That said, I can not see the users associated
>> with the group from Enterprise Manager, but know they can login to the
>> database.
>> The problem is this. When we login via the web we get access to the
>> database without problem, but when you look at the current_user what
>> you see is the login Name the user entered and NOT the name of the
>> group/User. That is to say, I can see a UserID which is not listed as
>> a User in SQL Server and can't see the name of the group, which is
>> listed as a user in SQL Server.
>> I need to know who's logging in order to direct them to the
>> appropriate web page via their role. Before the admin set up the
>> group, I was using sp_helpuser to get the role, but then again I had
>> the userID to do this.
>> The question I have now, is there any way to see what the
>> group/user is who logged in i.e. the goup listed as the User in
>> Enterprise Manager? Otherwise I have to build a table of userIDs and
>> their group/User name, which seems to defeat the purpose of having he
>> server authenticate users.
>>
>> Thanks,
>> Tom
>I'm not sure I understand your setup completely, but if you use CURRENT_USER
>you will see the user name in the current database, not the login name. If
>you use SYSTEM_USER instead, you should see the user's login - does this
>give the result you expect?
>If not, then perhaps you could clarify the sequence of events used to set up
>the group, espeically the difference between a server login and a database
>user - this is what's not entirely clear from your post above. If you can
>provide the actual SQL commands used to set up server access and permissions
>for the Windows group, that would be the least ambiguous description,
>although of course you may well have done it through Enterprise Manager
>instead.
>Simon

Friday, February 24, 2012

How to find data/text within SQL DB

Hi there, posted the same question in FULLTEXT group, but I think this group
could also help me, cos it is not just FULLTEXT related
I have a problem and don't know how to resolve it. I had sharepoint portal
server 2003, then it was upgraded to 2007, but after that two meeting
workspace been lost. Lost from sharepoint site, but not from the DB. Wrote
to sharepoint group and one guy just started with step buy step guide about
how could I find it within SQL DB
http://www.developerfood.com/lost-meeting-workspace-after-2003to2007-inplace-upgrade/microsoft-public-sharepoint-portalserver/44bdf402-c511-45a8-8452-bb1d95cb2908/article.aspx
but he never replied me
Please could some one help me with that?
Thank you in advance
Hi
"Guzun, Alex" wrote:

> Hi there, posted the same question in FULLTEXT group, but I think this group
> could also help me, cos it is not just FULLTEXT related
> I have a problem and don't know how to resolve it. I had sharepoint portal
> server 2003, then it was upgraded to 2007, but after that two meeting
> workspace been lost. Lost from sharepoint site, but not from the DB. Wrote
> to sharepoint group and one guy just started with step buy step guide about
> how could I find it within SQL DB
> http://www.developerfood.com/lost-meeting-workspace-after-2003to2007-inplace-upgrade/microsoft-public-sharepoint-portalserver/44bdf402-c511-45a8-8452-bb1d95cb2908/article.aspx
> but he never replied me
> Please could some one help me with that?
> Thank you in advance
>
All the posts don't seem to be available! http://tinyurl.com/yr38vs shows
more replies. I don't know sharepoint so I am not sure what should be in the
sites table, but if you could restore a copy of the database to a different
server (or under a different database name on the same server) you will be
able to compare the contents and see if they are different.
John

How to find data/text within SQL DB

Hi there, posted the same question in FULLTEXT group, but I think this group
could also help me, cos it is not just FULLTEXT related :)
I have a problem and don't know how to resolve it. I had sharepoint portal
server 2003, then it was upgraded to 2007, but after that two meeting
workspace been lost. Lost from sharepoint site, but not from the DB. Wrote
to sharepoint group and one guy just started with step buy step guide about
how could I find it within SQL DB
http://www.developerfood.com/lost-meeting-workspace-after-2003to2007-inplace-upgrade/microsoft-public-sharepoint-portalserver/44bdf402-c511-45a8-8452-bb1d95cb2908/article.aspx
but he never replied me
Please could some one help me with that?
Thank you in advanceHi
"Guzun, Alex" wrote:
> Hi there, posted the same question in FULLTEXT group, but I think this group
> could also help me, cos it is not just FULLTEXT related :)
> I have a problem and don't know how to resolve it. I had sharepoint portal
> server 2003, then it was upgraded to 2007, but after that two meeting
> workspace been lost. Lost from sharepoint site, but not from the DB. Wrote
> to sharepoint group and one guy just started with step buy step guide about
> how could I find it within SQL DB
> http://www.developerfood.com/lost-meeting-workspace-after-2003to2007-inplace-upgrade/microsoft-public-sharepoint-portalserver/44bdf402-c511-45a8-8452-bb1d95cb2908/article.aspx
> but he never replied me
> Please could some one help me with that?
> Thank you in advance
>
All the posts don't seem to be available! http://tinyurl.com/yr38vs shows
more replies. I don't know sharepoint so I am not sure what should be in the
sites table, but if you could restore a copy of the database to a different
server (or under a different database name on the same server) you will be
able to compare the contents and see if they are different.
John

How to find data/text within SQL DB

Hi there, posted the same question in FULLTEXT group, but I think this group
could also help me, cos it is not just FULLTEXT related
I have a problem and don't know how to resolve it. I had sharepoint portal
server 2003, then it was upgraded to 2007, but after that two meeting
workspace been lost. Lost from sharepoint site, but not from the DB. Wrote
to sharepoint group and one guy just started with step buy step guide about
how could I find it within SQL DB
http://www.developerfood.com/lost-m.../>
rticle.aspx
but he never replied me
Please could some one help me with that?
Thank you in advanceHi
"Guzun, Alex" wrote:

> Hi there, posted the same question in FULLTEXT group, but I think this gro
up
> could also help me, cos it is not just FULLTEXT related
> I have a problem and don't know how to resolve it. I had sharepoint portal
> server 2003, then it was upgraded to 2007, but after that two meeting
> workspace been lost. Lost from sharepoint site, but not from the DB. Wrote
> to sharepoint group and one guy just started with step buy step guide abou
t
> how could I find it within SQL DB
> http://www.developerfood.com/lost-m...
/article.aspx
> but he never replied me
> Please could some one help me with that?
> Thank you in advance
>
All the posts don't seem to be available! http://tinyurl.com/yr38vs shows
more replies. I don't know sharepoint so I am not sure what should be in the
sites table, but if you could restore a copy of the database to a different
server (or under a different database name on the same server) you will be
able to compare the contents and see if they are different.
John

Sunday, February 19, 2012

how to filter output based on user's AD group membership?

I want to filter reports based on a users active directory security i.e. what
parameters they can select, what columns they can see
But I can't figure out the best way of doing this and the documentation on
AD seems to assume that the user already understands AD.
From what I can tell I have two options
1) use sql with the openquery syntax - don't think this is going to be an
option due to the hassle here of setting up linked servers (bureaucracy in
the extreme)
2)use system.directoryservices with some code built into to the report - i
don't really understand how to do this, none of the code samples i have seen
seem to do what I want e.g. pass in username from global report parameters
along with the groupname i want to check against, and return whether they are
in that particular group as true/false
help greatly appreciated!
do you know a better way of doing this? code samples? etc
thanks!AD queries in SQL Server using the ADSI can be a problem... I am told it will
only search the first 1000 rows returned by the AD..
if you are using SQL 2005... Take a look at the sys.login_token
It shows all of the AD groups the user is a member of.
--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
I support the Professional Association for SQL Server ( PASS) and it''s
community of SQL Professionals.
"adolf garlic" wrote:
> I want to filter reports based on a users active directory security i.e. what
> parameters they can select, what columns they can see
> But I can't figure out the best way of doing this and the documentation on
> AD seems to assume that the user already understands AD.
> From what I can tell I have two options
> 1) use sql with the openquery syntax - don't think this is going to be an
> option due to the hassle here of setting up linked servers (bureaucracy in
> the extreme)
> 2)use system.directoryservices with some code built into to the report - i
> don't really understand how to do this, none of the code samples i have seen
> seem to do what I want e.g. pass in username from global report parameters
> along with the groupname i want to check against, and return whether they are
> in that particular group as true/false
> help greatly appreciated!
> do you know a better way of doing this? code samples? etc
> thanks!