Showing posts with label msdn. Show all posts
Showing posts with label msdn. Show all posts

Wednesday, March 21, 2012

Primary Key on Two Columns

How can I create a primary key on two columns? I could not find any sensible code sample or description how it should be done. It is clear from MSDN that it is possible but there are no examples.

There is a textbox "Included Columns" in one of the tools for setting primary keys for one column but it does not allow me to enter anything.

Thanks.

Drop table T1

CREATE TABLE [dbo].[T1](

[c1] char(10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

Angel [int] NOT NULL,

Beer [nchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

CONSTRAINT [PK_T1] PRIMARY KEY CLUSTERED

(

Angel ASC,

Beer ASC

)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]

one way is as above mentioned , here your pk will be created on column a and b

from Management studio , open the table highlight the multiple colum and press right button. you can select set primary key option

Madhu

|||This is cute, esp the management studio approach. Thank you.

Monday, February 20, 2012

Prevent users from browsing the reporting server site?

Dear MSDN!
Are there some way to prevent users from browsing the reporting server site?
The reason for this is that we want to access the reports on the reporting
services from our own website with POST parameters to the reports.
Thanks in advance!You should be able to control access via IIS and Active Directory.
"MrGrundh" <MrGrundh@.nospam.nospam> wrote in message
news:320B63A2-7C12-4CC4-9C73-124BB72C9A60@.microsoft.com...
> Dear MSDN!
> Are there some way to prevent users from browsing the reporting server
> site?
> The reason for this is that we want to access the reports on the reporting
> services from our own website with POST parameters to the reports.
> Thanks in advance!|||Could you be more specific?
"Rodney Mullins" wrote:
> You should be able to control access via IIS and Active Directory.
> "MrGrundh" <MrGrundh@.nospam.nospam> wrote in message
> news:320B63A2-7C12-4CC4-9C73-124BB72C9A60@.microsoft.com...
> > Dear MSDN!
> >
> > Are there some way to prevent users from browsing the reporting server
> > site?
> >
> > The reason for this is that we want to access the reports on the reporting
> > services from our own website with POST parameters to the reports.
> >
> > Thanks in advance!
>
>|||It is a bad idea to start messing around with IIS. Any access control should
be done with RS roles.
I haven't done this but it is worth a try. Create a new role. Allow it to
view reports only (i.e. don't give it View Folders rights). Try assigning a
user to that role and see if it does as you want.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"MrGrundh" <MrGrundh@.nospam.nospam> wrote in message
news:C3ACED47-CED1-4BF6-83B9-5AA81BD914F7@.microsoft.com...
> Could you be more specific?
> "Rodney Mullins" wrote:
>> You should be able to control access via IIS and Active Directory.
>> "MrGrundh" <MrGrundh@.nospam.nospam> wrote in message
>> news:320B63A2-7C12-4CC4-9C73-124BB72C9A60@.microsoft.com...
>> > Dear MSDN!
>> >
>> > Are there some way to prevent users from browsing the reporting server
>> > site?
>> >
>> > The reason for this is that we want to access the reports on the
>> > reporting
>> > services from our own website with POST parameters to the reports.
>> >
>> > Thanks in advance!
>>|||Hi Bruce!
Your suggestion did not work. A user can still use the URL to the report and
browse it.
http://myServer/reportserver?/SalesReports/CORES.Report.Sales2_1
"Bruce L-C [MVP]" wrote:
> It is a bad idea to start messing around with IIS. Any access control should
> be done with RS roles.
> I haven't done this but it is worth a try. Create a new role. Allow it to
> view reports only (i.e. don't give it View Folders rights). Try assigning a
> user to that role and see if it does as you want.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "MrGrundh" <MrGrundh@.nospam.nospam> wrote in message
> news:C3ACED47-CED1-4BF6-83B9-5AA81BD914F7@.microsoft.com...
> > Could you be more specific?
> >
> > "Rodney Mullins" wrote:
> >
> >> You should be able to control access via IIS and Active Directory.
> >>
> >> "MrGrundh" <MrGrundh@.nospam.nospam> wrote in message
> >> news:320B63A2-7C12-4CC4-9C73-124BB72C9A60@.microsoft.com...
> >> > Dear MSDN!
> >> >
> >> > Are there some way to prevent users from browsing the reporting server
> >> > site?
> >> >
> >> > The reason for this is that we want to access the reports on the
> >> > reporting
> >> > services from our own website with POST parameters to the reports.
> >> >
> >> > Thanks in advance!
> >>
> >>
> >>
>
>|||Ahh, I thought you didn't want them to see the list of reports.
There is no way around the URL working for the user to view a specific
report. Or at least not without a whole lot of work. If you implement forms
authentication and then in your app you use a virtual user to view the
report then you could prevent this.
Note that if the goal is that only certain users should see a particular
report that is easy or if a user should only see certain data, that is also
easy.
In the latter case use the global variable User!UserID and have your data us
that user id to only present data that user should see.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"MrGrundh" <MrGrundh@.nospam.nospam> wrote in message
news:4F088003-0FC8-429D-AF5B-2E70A0E80BAD@.microsoft.com...
> Hi Bruce!
> Your suggestion did not work. A user can still use the URL to the report
> and
> browse it.
> http://myServer/reportserver?/SalesReports/CORES.Report.Sales2_1
>
> "Bruce L-C [MVP]" wrote:
>> It is a bad idea to start messing around with IIS. Any access control
>> should
>> be done with RS roles.
>> I haven't done this but it is worth a try. Create a new role. Allow it to
>> view reports only (i.e. don't give it View Folders rights). Try assigning
>> a
>> user to that role and see if it does as you want.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "MrGrundh" <MrGrundh@.nospam.nospam> wrote in message
>> news:C3ACED47-CED1-4BF6-83B9-5AA81BD914F7@.microsoft.com...
>> > Could you be more specific?
>> >
>> > "Rodney Mullins" wrote:
>> >
>> >> You should be able to control access via IIS and Active Directory.
>> >>
>> >> "MrGrundh" <MrGrundh@.nospam.nospam> wrote in message
>> >> news:320B63A2-7C12-4CC4-9C73-124BB72C9A60@.microsoft.com...
>> >> > Dear MSDN!
>> >> >
>> >> > Are there some way to prevent users from browsing the reporting
>> >> > server
>> >> > site?
>> >> >
>> >> > The reason for this is that we want to access the reports on the
>> >> > reporting
>> >> > services from our own website with POST parameters to the reports.
>> >> >
>> >> > Thanks in advance!
>> >>
>> >>
>> >>
>>|||It is not possible to use a "virtual user" when accessing reporting server
because we use POST method with parameters.
"Bruce L-C [MVP]" wrote:
> Ahh, I thought you didn't want them to see the list of reports.
> There is no way around the URL working for the user to view a specific
> report. Or at least not without a whole lot of work. If you implement forms
> authentication and then in your app you use a virtual user to view the
> report then you could prevent this.
> Note that if the goal is that only certain users should see a particular
> report that is easy or if a user should only see certain data, that is also
> easy.
> In the latter case use the global variable User!UserID and have your data us
> that user id to only present data that user should see.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "MrGrundh" <MrGrundh@.nospam.nospam> wrote in message
> news:4F088003-0FC8-429D-AF5B-2E70A0E80BAD@.microsoft.com...
> > Hi Bruce!
> >
> > Your suggestion did not work. A user can still use the URL to the report
> > and
> > browse it.
> >
> > http://myServer/reportserver?/SalesReports/CORES.Report.Sales2_1
> >
> >
> > "Bruce L-C [MVP]" wrote:
> >
> >> It is a bad idea to start messing around with IIS. Any access control
> >> should
> >> be done with RS roles.
> >>
> >> I haven't done this but it is worth a try. Create a new role. Allow it to
> >> view reports only (i.e. don't give it View Folders rights). Try assigning
> >> a
> >> user to that role and see if it does as you want.
> >>
> >>
> >> --
> >> Bruce Loehle-Conger
> >> MVP SQL Server Reporting Services
> >>
> >> "MrGrundh" <MrGrundh@.nospam.nospam> wrote in message
> >> news:C3ACED47-CED1-4BF6-83B9-5AA81BD914F7@.microsoft.com...
> >> > Could you be more specific?
> >> >
> >> > "Rodney Mullins" wrote:
> >> >
> >> >> You should be able to control access via IIS and Active Directory.
> >> >>
> >> >> "MrGrundh" <MrGrundh@.nospam.nospam> wrote in message
> >> >> news:320B63A2-7C12-4CC4-9C73-124BB72C9A60@.microsoft.com...
> >> >> > Dear MSDN!
> >> >> >
> >> >> > Are there some way to prevent users from browsing the reporting
> >> >> > server
> >> >> > site?
> >> >> >
> >> >> > The reason for this is that we want to access the reports on the
> >> >> > reporting
> >> >> > services from our own website with POST parameters to the reports.
> >> >> >
> >> >> > Thanks in advance!
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>