Showing posts with label custom. Show all posts
Showing posts with label custom. Show all posts

Wednesday, March 28, 2012

Persisting data in custom aggregate

I want to create a custom aggregate to calculate percentiles.
For example:
The 50th percentile is calculated by extracting the value(s) in the centre
of a sorted dataset.
What I need in this case is a sorted dataset so that I can extract values at
specific indexes to be able to calculate different percentiles.
1) At the moment I'm using a Private ArrayList to persist the intermediate
data.
2) The Accumalate method is used to add the data to the ArrayList.
3) I use the Terminate method to sort the ArrayList and extract the values I
need at specific index(es)
4) The Merge method appends two ArrayList's
Unfortunately I have no idea what to do in the Read and Write methods
concerning the ArrayList.
The way I understand it is that the Write method should write the ArratList
in a binary format which the Read are able to consume.
I am quite new at this so any ideas would be appreciated.
JR MalherbeJames
Does it relate somehow to SQL Server?
If it does ,please post DDL+ sample data+ expected result.
"JamesM" <JamesM@.discussions.microsoft.com> wrote in message
news:BE227508-8478-4758-903B-5DDB2E25D723@.microsoft.com...
>I want to create a custom aggregate to calculate percentiles.
> For example:
> The 50th percentile is calculated by extracting the value(s) in the centre
> of a sorted dataset.
> What I need in this case is a sorted dataset so that I can extract values
> at
> specific indexes to be able to calculate different percentiles.
> 1) At the moment I'm using a Private ArrayList to persist the intermediate
> data.
> 2) The Accumalate method is used to add the data to the ArrayList.
> 3) I use the Terminate method to sort the ArrayList and extract the values
> I
> need at specific index(es)
> 4) The Merge method appends two ArrayList's
> Unfortunately I have no idea what to do in the Read and Write methods
> concerning the ArrayList.
> The way I understand it is that the Write method should write the
> ArratList
> in a binary format which the Read are able to consume.
> I am quite new at this so any ideas would be appreciated.
> --
> JR Malherbe|||JamesM wrote:
> I want to create a custom aggregate to calculate percentiles.
> For example:
> The 50th percentile is calculated by extracting the value(s) in the centre
> of a sorted dataset.
> What I need in this case is a sorted dataset so that I can extract values
at
> specific indexes to be able to calculate different percentiles.
> 1) At the moment I'm using a Private ArrayList to persist the intermediate
> data.
> 2) The Accumalate method is used to add the data to the ArrayList.
> 3) I use the Terminate method to sort the ArrayList and extract the values
I
> need at specific index(es)
> 4) The Merge method appends two ArrayList's
> Unfortunately I have no idea what to do in the Read and Write methods
> concerning the ArrayList.
> The way I understand it is that the Write method should write the ArratLis
t
> in a binary format which the Read are able to consume.
> I am quite new at this so any ideas would be appreciated.
> --
> JR Malherbe
SQL Server 2005? Use the NTILE or RANK aggregate functions. I don't see
why you would need a user-defined aggregate but if you still think you
do then please give us a better spec.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||"Uri Dimant" wrote:

> James
> Does it relate somehow to SQL Server?
> If it does ,please post DDL+ sample data+ expected result.
This relates to extending SQL2005 with CLR functions (in this case a user
defined aggregate)
I'm trying to write a aggregate which is doing the same as the PERSENTILE
function in Excel
I'll post my code and expected results with David Portas|||"David Portas" wrote:
> SQL Server 2005? Use the NTILE or RANK aggregate functions. I don't see
> why you would need a user-defined aggregate but if you still think you
> do then please give us a better spec.
Unfortunately not
The function needs to do what the PERCENTILE function in Excel does
example 1 (uneven number of records)
You have a sorted list of values: (20,23,34,56,58,61,67,70,72,84,85)
In this case the the 50th percentile is the center value = 61
example 2 (even number of records)
You have a sorted list of values: (20,23,34,56,58,61,67,70,72,84,85,88)
In this case the the 50th percentile is the average of the two center values
= (61+67)/2 = 64
Here is my code:
using System;
using System.Data;
using System.Data.Sql;
using System.Data.SqlTypes;
using System.Collections;
using Microsoft.SqlServer.Server;
using System.IO;
[Serializable]
[SqlUserDefinedAggregate(
Format.UserDefined,
IsInvariantToNulls = true,
IsInvariantToDuplicates = false,
IsInvariantToOrder = false,
MaxByteSize = 8000)
]
public class Median : IBinarySerialize
{
private ArrayList intermediateResult;
public void Init()
{
intermediateResult = new ArrayList();
}
public void Accumulate(SqlDouble Value)
{
if (Value.IsNull)
{
return;
}
intermediateResult.Add(Value.Value);
}
public void Merge(Median Group)
{
intermediateResult.InsertRange(0, Group.intermediateResult);
}
public SqlDouble Terminate()
{
double output = double.NaN;
if (intermediateResult != null && intermediateResult.Count > 0)
{
double cntItem = intermediateResult.Count;
if (cntItem > 10)
{
intermediateResult.Sort();
double pos_relative = (cntItem - 1) * 0.5; //median
int pos1 = Convert.ToInt32(Math.Floor(pos_relative));
double pos_fraction = pos_relative - pos1;
if (pos_fraction == 0)
output = Convert.ToDouble(intermediateResult[pos1]);
else
output = Convert.ToDouble(intermediateResult[pos1]) +
pos_fraction * (Convert.ToDouble(intermediateResult[pos1 + 1]) -
Convert.ToDouble(intermediateResult[pos1]));
}
}
return new SqlDouble(output);
}
public void Read(BinaryReader r)
{
//need to read binary to intermediateResult from the format that was
used below
}
public void Write(BinaryWriter w)
{
//need to write intermediateResult to a binary format
}
}|||James
CREATE TABLE #Test
(
num INT
)
INSERT INTO #Test VALUES (20)
INSERT INTO #Test VALUES (23)
INSERT INTO #Test VALUES (34)
INSERT INTO #Test VALUES (56)
INSERT INTO #Test VALUES (58)
INSERT INTO #Test VALUES (61)
INSERT INTO #Test VALUES (67)
INSERT INTO #Test VALUES (70)
INSERT INTO #Test VALUES (72)
INSERT INTO #Test VALUES (84)
INSERT INTO #Test VALUES (85)
INSERT INTO #Test VALUES (88)
SELECT AVG( b3.num )
FROM (
SELECT MAX( b1.num )
FROM (
SELECT TOP 50 PERCENT b.num
FROM #Test AS b
ORDER BY b.num ASC
) AS b1
UNION ALL
SELECT MIN( b2.num )
FROM (
SELECT TOP 50 PERCENT b.num
FROM #Test AS b
ORDER BY b.num DESC
) AS b2
) AS b3( num )
"JamesM" <JamesM@.discussions.microsoft.com> wrote in message
news:7945781D-56E4-4C5B-B915-2AD4284FBA04@.microsoft.com...
> "David Portas" wrote:
> Unfortunately not
>
> The function needs to do what the PERCENTILE function in Excel does
> example 1 (uneven number of records)
> You have a sorted list of values: (20,23,34,56,58,61,67,70,72,84,85)
> In this case the the 50th percentile is the center value = 61
> example 2 (even number of records)
> You have a sorted list of values: (20,23,34,56,58,61,67,70,72,84,85,88)
> In this case the the 50th percentile is the average of the two center
> values
> = (61+67)/2 = 64
>
> Here is my code:
> using System;
> using System.Data;
> using System.Data.Sql;
> using System.Data.SqlTypes;
> using System.Collections;
> using Microsoft.SqlServer.Server;
> using System.IO;
> [Serializable]
> [SqlUserDefinedAggregate(
> Format.UserDefined,
> IsInvariantToNulls = true,
> IsInvariantToDuplicates = false,
> IsInvariantToOrder = false,
> MaxByteSize = 8000)
> ]
> public class Median : IBinarySerialize
> {
> private ArrayList intermediateResult;
> public void Init()
> {
> intermediateResult = new ArrayList();
> }
> public void Accumulate(SqlDouble Value)
> {
> if (Value.IsNull)
> {
> return;
> }
> intermediateResult.Add(Value.Value);
> }
> public void Merge(Median Group)
> {
> intermediateResult.InsertRange(0, Group.intermediateResult);
> }
> public SqlDouble Terminate()
> {
> double output = double.NaN;
> if (intermediateResult != null && intermediateResult.Count > 0)
> {
> double cntItem = intermediateResult.Count;
> if (cntItem > 10)
> {
> intermediateResult.Sort();
> double pos_relative = (cntItem - 1) * 0.5; //median
> int pos1 = Convert.ToInt32(Math.Floor(pos_relative));
> double pos_fraction = pos_relative - pos1;
> if (pos_fraction == 0)
> output = Convert.ToDouble(intermediateResult[pos1]);
> else
> output = Convert.ToDouble(intermediateResult[pos1]) +
> pos_fraction * (Convert.ToDouble(intermediateResult[pos1 + 1]) -
> Convert.ToDouble(intermediateResult[pos1]));
> }
> }
> return new SqlDouble(output);
> }
> public void Read(BinaryReader r)
> {
> //need to read binary to intermediateResult from the format that
> was
> used below
> }
> public void Write(BinaryWriter w)
> {
> //need to write intermediateResult to a binary format
> }
> }
>|||Thanks Uri
We also have workarouds in SQL, which is very tedious if you are calculating
different percentiles (10th, 25th, 50th,...) in different columns and at
different break levels.
We chose to go the route of a custom aggregate since this will save us lots
of work in the next 10 months.
All I need to know is how to persist an ArrayList for a user defined
aggregate.

Persisting a SqlDataReader in a SqlFunction enumerator

I have built a Table Valued SqlFunction which streams out filtered results from a table. The way that I have implemented this is by using a custom class which implements the IEnumerator interface.

The class internally stores a SqlDataReader and a SqlConnection as private member variables. The Class initializer (ie: the New function) creates a SqlCommand which is executed with ExecuteReader into the SqlDataReader and returns.

The IEnumerator.MoveNext method loops through the SqlDataReader until it finds a result which matches the heuristic filter, and the IEnumerator.Current method returns the current result from the SqlDataReader.

Unfortunately as soon as the initializer returns the SqlDataReader is automatically closed, and I can't figure out why. I've debugged through this and at the end of the Initializer the SqlDataReader is definately open, and as soon as first call to MoveNext is run it is closed.

Can anyone offer any suggestions on how I can fix this.

In the interim i've had to load all of the filtered results into a temporary ArrayList in the Initializer, which defeats the purpose of streaming out the results.

"You can use the context connection in the initialization method ..., but not in the method that fills rows (the method pointed to by the FillRowMethodName attribute property)." (copy/pasted from Managed Data Access Inside SQL Server with ADO.NET and SQLCLR), so you cannot loop through the SqlDataReader inside FillRow method.

Solutions are:

Implement the filtering using T-SQL (if possible)|||I'm not using the FillRow method to access the SqlDataReader; it is just passed a copy of the object (it's a UDT in this case) which the IEnumerator.Current method returns. I am looping through the SqlDataReader in the IEnumerator.MoveNext method.

My code looks something like this (with large chunks of logic cut out):

Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Imports Microsoft.SqlServer.Server
Imports System.Runtime.InteropServices
Imports System.Collections
Imports System.Security
Imports System.Net

<Assembly: AllowPartiallyTrustedCallers()>

Public Class MyListIterator
Implements IEnumerator

Private oIncludes(0) As MySQLType
Private oExcludes(0) As MySQLType
Private oColumnMeta As SqlMetaData
Private oConn As SqlConnection
Private oDR As SqlDataReader
Private bMoreRecords As Boolean = False
Private iChannelAccountID As Integer

Public Sub New(ByVal ChannelAccountID As Integer)
iChannelAccountID = ChannelAccountID
InitReader()
End Sub

Private Sub InitReader()
oConn = New SqlConnection("context connection=true")
Debug("Starting InitReader")
Dim oCommand As SqlCommand
Dim oMyCode As MySQLType

' Set up the filter arrays (oIncludes and oExcludes) here
' ....
' end filter array setup

' now we'll just loop through all of the My codes and return those that match
oCommand = New SqlCommand("SELECT MyCode FROM MyCodes", oConn)
Dim oColumnMeta As New SqlMetaData("MyCode", SqlDbType.Udt, GetType(MySQLType))

oConn.Open()
oDR = oCommand.ExecuteReader()
bMoreRecords = True
' dont' need to get the first item
' the initial position of the result set is defined as "before the beginning"
End Sub

Public ReadOnly Property Current() As Object Implements System.Collections.IEnumerator.Current
Get
If bMoreRecords Then
Return oDR(0)
Else
Return Nothing
End If
End Get
End Property

Public Function MoveNext() As Boolean Implements System.Collections.IEnumerator.MoveNext
If bMoreRecords AndAlso Not oDR.IsClosed Then
' find the next included code
Do While oDR.Read
If CType(oDR(0), MySQLType).IsIncluded(oIncludes, oExcludes) Then Return True
Loop
End If
bMoreRecords = False
Return False ' no more records
End Function

Public Sub Reset() Implements System.Collections.IEnumerator.Reset
bMoreRecords = False
If Not oDR Is Nothing AndAlso oDR.IsClosed Then oDR.Close()
If Not oConn Is Nothing Then oConn.Close()
InitReader()
End Sub

End Class

Partial Public Class UserDefinedFunctions
<Microsoft.SqlServer.Server.SqlFunction(TableDefinition:="MyCode MySQLType", _
IsPrecise:=True, _
IsDeterministic:=False, _
DataAccess:=DataAccessKind.Read, _
FillRowMethodName:="FillMyListRow")> _
Public Shared Function GetMyList(ByVal ChannelAccountID As Integer) As IEnumerator
Return New MyListIterator(ChannelAccountID)
End Function

Public Shared Sub FillMyListRow(ByVal oMyInCode As Object, <Out()> ByRef oMyOutCode As MySQLType)
If Not oMyInCode Is Nothing Then
oMyOutCode = CType(oMyInCode, MySQLType)
Else
oMyOutCode = MySQLType.Null
End If
End Sub
End Class|||

Further to my last post, I can't use TSQL to create the filters because the logic is too complex (it relies on heirarchical data and complex type rules).

I have created the function as a SQLCLR stored procedure successfully however I was hoping to use a SqlFunction so that I could perform joins (eg: SELECT [whatever] FROM [mytable] WHERE [myfield] IN MyFunction(@.ChannelAccountID)).

One alternative is that I figure out how to join select results with the results returned from a stored procedure, however i haven't figured out how to do that without executing the stored procedure into a temporary table (and even that is simply what I guess that you could do; i haven't actually tried at this point).

I have also implemented a scalar valued CLR function which checks the filters, however this is unoptimal because I need to build the filter arrays again for each and every row in the table (about 20,000 rows). This performs too slow for my liking.

Cheers

Beric Holt

http://buzzrick.true.geek.nz

persistent SQLBrowser error eventID 3

I have what looks like a completed install of SQL Server Express Edition, accomplished via unattended setup as part of a custom application (on a machine hereafter dubbed Machine "A").

So far, though, I can't access this instance from a remote SQL Server Management Studio because SSMSE can't see the installed database engine.

I've verified that:

The SQL Server Express installation on Machine A has remote connections enabled.

The SQLBrowser on Machine A is enabled and running.

Machine A's Windows Firewall is disabled.

Using a test tool, I can see that UDP messages sent to SQLBrowser (on port 1434), arrive (i.e. it complains about their format in the System Log).

It seems that Machine A's SQLBrowser isn't responding to requests, but there's no obvious reason why.

There's one clue in Machine A's event log:

Whenever SQLBrowser is started or restarted, there's a warning in the App Log:

"The configuration of the AdminConnection\TCP protocol in the SQL instance SQLEXPRESS is not valid." (eventid 3).

Any help will be much appreciated.

Thanks in advance
Josh

Some more diverse testing reveals that the problem seems to occur only when SSMSEE is running on Windows 2000.

The source of the problem appears to be that W2K is not picking up the correct instance name (in other words, it puts MYSERVER in the list of engines, but not MYSERVER\SQLEXPRESS). If I key in MYSERVER\SQLEXPRESS by hand, things work as expected.

Incidentally, I noticed that when running under XP, the Network Server list shows which version of the SQL Engine is running on each server, but under Windows 2000, it does this only for very few of the servers.

Is this a shade of a known problem?

Josh

Friday, March 23, 2012

Permissions to run DBCC SHOWFILESTATS

All,
We have a custom app (that unfortunately can't be modified any time soon)
that uses the undocumented command "DBCC SHOWFILESTATS" to get data file
information. However, we need to allow non-admins/dbowners to use this
function. As I am not an SQL Server Admin, I haven't the faintest idea
how to allow this. I've tried GRANTing the right with no luck. Can anyone
help this poor schmoe out and tell me exactly how to grant execute rights
for DBCC SHOWFILESTATS on a given database (let's say Northwind for
example)?
Many thanks in advance.
--
--Sasquatch
"And I thought 'Reverend Billy ...', you know, which is good 'cause when I
think 'Reverend Debra ...', that's another set of problems altogether."
-- Rev. Billy C. WirtzTry Assigning System administrator role to that user (who
has to perform the dbcc showfilestats command).
>--Original Message--
>All,
>We have a custom app (that unfortunately can't be
modified any time soon)
>that uses the undocumented command "DBCC SHOWFILESTATS"
to get data file
>information. However, we need to allow non-
admins/dbowners to use this
>function. As I am not an SQL Server Admin, I haven't the
faintest idea
>how to allow this. I've tried GRANTing the right with no
luck. Can anyone
>help this poor schmoe out and tell me exactly how to
grant execute rights
>for DBCC SHOWFILESTATS on a given database (let's say
Northwind for
>example)?
>Many thanks in advance.
>--
>--Sasquatch
>"And I thought 'Reverend Billy ...', you know, which is
good 'cause when I
> think 'Reverend Debra ...', that's another set of
problems altogether."
> -- Rev. Billy C. Wirtz
>.
>|||Hi Sasquatch
There are many commands for which permission cannot be granted; many DBCC
commands, including this one, are in that category.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Sasquatch" <me@.nowhereinparticular.com> wrote in message
news:vroctgnrlcqt5b@.corp.supernews.com...
> All,
> We have a custom app (that unfortunately can't be modified any time soon)
> that uses the undocumented command "DBCC SHOWFILESTATS" to get data file
> information. However, we need to allow non-admins/dbowners to use this
> function. As I am not an SQL Server Admin, I haven't the faintest idea
> how to allow this. I've tried GRANTing the right with no luck. Can anyone
> help this poor schmoe out and tell me exactly how to grant execute rights
> for DBCC SHOWFILESTATS on a given database (let's say Northwind for
> example)?
> Many thanks in advance.
> --
> --Sasquatch
> "And I thought 'Reverend Billy ...', you know, which is good 'cause when I
> think 'Reverend Debra ...', that's another set of problems altogether."
> -- Rev. Billy C. Wirtz|||Sasquatch
Please do not post the same question simultaneously in multiple newsgroups.
This has been answered in another group already.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Sasquatch" <me@.nowhereinparticular.com> wrote in message
news:vroctgnrlcqt5b@.corp.supernews.com...
> All,
> We have a custom app (that unfortunately can't be modified any time soon)
> that uses the undocumented command "DBCC SHOWFILESTATS" to get data file
> information. However, we need to allow non-admins/dbowners to use this
> function. As I am not an SQL Server Admin, I haven't the faintest idea
> how to allow this. I've tried GRANTing the right with no luck. Can anyone
> help this poor schmoe out and tell me exactly how to grant execute rights
> for DBCC SHOWFILESTATS on a given database (let's say Northwind for
> example)?
> Many thanks in advance.
> --
> --Sasquatch
> "And I thought 'Reverend Billy ...', you know, which is good 'cause when I
> think 'Reverend Debra ...', that's another set of problems altogether."
> -- Rev. Billy C. Wirtz|||Mangai
This is NOT recommended if you care at all about security and integrity of
your database. Putting someone in the sysadmin role gives them far too much
privilege, and that role should be restricted to those who really need full
privilege.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Mangai" <anonymous@.discussions.microsoft.com> wrote in message
news:06ac01c3af25$5e739630$a501280a@.phx.gbl...
> Try Assigning System administrator role to that user (who
> has to perform the dbcc showfilestats command).
> >--Original Message--
> >All,
> >
> >We have a custom app (that unfortunately can't be
> modified any time soon)
> >that uses the undocumented command "DBCC SHOWFILESTATS"
> to get data file
> >information. However, we need to allow non-
> admins/dbowners to use this
> >function. As I am not an SQL Server Admin, I haven't the
> faintest idea
> >how to allow this. I've tried GRANTing the right with no
> luck. Can anyone
> >help this poor schmoe out and tell me exactly how to
> grant execute rights
> >for DBCC SHOWFILESTATS on a given database (let's say
> Northwind for
> >example)?
> >
> >Many thanks in advance.
> >
> >--
> >--Sasquatch
> >
> >"And I thought 'Reverend Billy ...', you know, which is
> good 'cause when I
> > think 'Reverend Debra ...', that's another set of
> problems altogether."
> > -- Rev. Billy C. Wirtz
> >.
> >|||You can use
select
fileid,
groupid,
size/8 as TotalExtents,
fileproperty(name,'SpaceUsed')/8 as UsedExtents,
name,
filename
from sysfiles
where groupid <> 0
to give you the same output as DBCC SHOWFILESTATS. You
only need public access to run this. You can comment out
the where clause to give you figures for the log files as
well.
As you can't change the app, this probably doesn't help.
>--Original Message--
>All,
>We have a custom app (that unfortunately can't be
modified any time soon)
>that uses the undocumented command "DBCC SHOWFILESTATS"
to get data file
>information. However, we need to allow non-
admins/dbowners to use this
>function. As I am not an SQL Server Admin, I haven't the
faintest idea
>how to allow this. I've tried GRANTing the right with no
luck. Can anyone
>help this poor schmoe out and tell me exactly how to
grant execute rights
>for DBCC SHOWFILESTATS on a given database (let's say
Northwind for
>example)?
>Many thanks in advance.
>--
>--Sasquatch
>"And I thought 'Reverend Billy ...', you know, which is
good 'cause when I
> think 'Reverend Debra ...', that's another set of
problems altogether."
> -- Rev. Billy C. Wirtz
>.
>

Monday, March 12, 2012

Permissions for dll in rssrvpolicy.config

I have built some custom authentication library but have run into a problem.
The custom code uses MySql.Data.dll(a library from MySQL for .NET) to
authenticate users against a MySQL db.
I get an connection error when I attempt to connect and believe that it is
because of CodeGroup permissions that need to be set in the
rssrvpolicy.config file.
I have added a code group as:
<CodeGroup
class="UnionCodeGroup"
version="1"
Name="MySQL"
Description="Code group for the security extension MySQL"
PermissionSetName="FullTrust">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="D:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\MySql.Data.dll"
/>
but still no sucess.
Any ideas? Are there any other security settings?
The server is 2003 with IIS 6.
ThanksI used filemon.exe from SysInternals.com to debug a security
permissions problem with my custom assembly recently. It will show you
if the dll is being loaded and if not, what is preventing it from being
loaded. My solution involved using the file properties - security tab
to compare the allowable user groups on the custom dll to other dll's
in the bin folder.
This may be an obvious question... you have given permission to the
MySQL.Data.dll, but have you given the correct permissions to your
custom dll that uses that library?
I have also seen other posts that comment on the placement of the code
group in the code group heirarchy. Most recommend placing new code
groups right under the root code group node. Let us know what you find.|||Thank so much for your thoughts.
I took your advice and changed the order of the code groups for the DLL's
and it worked. I have the MySQL dll entry followed by custom library.
What is also to be noted is that I did not have to add any entries for the
MySQL dll or my custom dll when I was working on 2000 server with IIS 5.0.
IIS 6.0 has much tighter security.
Problem solved.
Thanks again,
Kevin
<bcsmith@.gmail.com> wrote in message
news:1106250549.705855.130230@.c13g2000cwb.googlegroups.com...
>I used filemon.exe from SysInternals.com to debug a security
> permissions problem with my custom assembly recently. It will show you
> if the dll is being loaded and if not, what is preventing it from being
> loaded. My solution involved using the file properties - security tab
> to compare the allowable user groups on the custom dll to other dll's
> in the bin folder.
> This may be an obvious question... you have given permission to the
> MySQL.Data.dll, but have you given the correct permissions to your
> custom dll that uses that library?
> I have also seen other posts that comment on the placement of the code
> group in the code group heirarchy. Most recommend placing new code
> groups right under the root code group node. Let us know what you find.
>

permissions for custom roles

I am on sql 2000 sp 4, windows 2003.
I am looking for a way to create custom database roles that are more
exacting than db_datareader, db_dbowner etc. What I need to do is to
create roles for the help desk personnel where they can view scheduled
jobs, but not edit them or create them. I also need to grant access to
edit DTS packages but not delete or create the. Does anyone have any
experience or good articles about this?
Thanks!
KristinaKristina,
Did you already get help through googlegroups? A couple of simple things on
SQL Server 2000.
Make those who should monitor jobs and schedules but not change them members
of the msdb TargetServersRole role. (Member of this role _cannot_ create new
jobs, so do not use this for someone who must also create jobs.)
Regarding DTS packages, I keep them stored on the file system, not in msdb.
Therefore, I control edit rights by giving the needed users Read access to
the DTS folders, but not Change rights.
RLF
"Kristina" <KristinaDBA@.gmail.com> wrote in message
news:1184982108.759067.184370@.r34g2000hsd.googlegroups.com...
>I am on sql 2000 sp 4, windows 2003.
> I am looking for a way to create custom database roles that are more
> exacting than db_datareader, db_dbowner etc. What I need to do is to
> create roles for the help desk personnel where they can view scheduled
> jobs, but not edit them or create them. I also need to grant access to
> edit DTS packages but not delete or create the. Does anyone have any
> experience or good articles about this?
> Thanks!
> Kristina
>|||On Jul 23, 10:44 am, "Russell Fields" <russellfie...@.nomail.com>
wrote:
> Kristina,
> Did you already get help through googlegroups? A couple of simple things on
> SQL Server 2000.
> Make those who should monitor jobs and schedules but not change them members
> of the msdb TargetServersRole role. (Member of this role _cannot_ create new
> jobs, so do not use this for someone who must also create jobs.)
> Regarding DTS packages, I keep them stored on the file system, not in msdb.
> Therefore, I control edit rights by giving the needed users Read access to
> the DTS folders, but not Change rights.
> RLF"Kristina" <Kristina...@.gmail.com> wrote in message
> news:1184982108.759067.184370@.r34g2000hsd.googlegroups.com...
>
> >I am on sql 2000 sp 4, windows 2003.
> > I am looking for a way to create custom database roles that are more
> > exacting than db_datareader, db_dbowner etc. What I need to do is to
> > create roles for the help desk personnel where they can view scheduled
> > jobs, but not edit them or create them. I also need to grant access to
> > edit DTS packages but not delete or create the. Does anyone have any
> > experience or good articles about this?
> > Thanks!
> > Kristina- Hide quoted text -
> - Show quoted text -
Russell,
Thanks as always. This is the perfect advice I need! I have a crazy
new contract and I am the developer/DBA etc and don't have time to
research etc.
Kristina

permissions for custom roles

I am on sql 2000 sp 4, windows 2003.
I am looking for a way to create custom database roles that are more
exacting than db_datareader, db_dbowner etc. What I need to do is to
create roles for the help desk personnel where they can view scheduled
jobs, but not edit them or create them. I also need to grant access to
edit DTS packages but not delete or create the. Does anyone have any
experience or good articles about this?
Thanks!
Kristina
Kristina,
Did you already get help through googlegroups? A couple of simple things on
SQL Server 2000.
Make those who should monitor jobs and schedules but not change them members
of the msdb TargetServersRole role. (Member of this role _cannot_ create new
jobs, so do not use this for someone who must also create jobs.)
Regarding DTS packages, I keep them stored on the file system, not in msdb.
Therefore, I control edit rights by giving the needed users Read access to
the DTS folders, but not Change rights.
RLF
"Kristina" <KristinaDBA@.gmail.com> wrote in message
news:1184982108.759067.184370@.r34g2000hsd.googlegr oups.com...
>I am on sql 2000 sp 4, windows 2003.
> I am looking for a way to create custom database roles that are more
> exacting than db_datareader, db_dbowner etc. What I need to do is to
> create roles for the help desk personnel where they can view scheduled
> jobs, but not edit them or create them. I also need to grant access to
> edit DTS packages but not delete or create the. Does anyone have any
> experience or good articles about this?
> Thanks!
> Kristina
>
|||On Jul 23, 10:44 am, "Russell Fields" <russellfie...@.nomail.com>
wrote:
> Kristina,
> Did you already get help through googlegroups? A couple of simple things on
> SQL Server 2000.
> Make those who should monitor jobs and schedules but not change them members
> of the msdb TargetServersRole role. (Member of this role _cannot_ create new
> jobs, so do not use this for someone who must also create jobs.)
> Regarding DTS packages, I keep them stored on the file system, not in msdb.
> Therefore, I control edit rights by giving the needed users Read access to
> the DTS folders, but not Change rights.
> RLF"Kristina" <Kristina...@.gmail.com> wrote in message
> news:1184982108.759067.184370@.r34g2000hsd.googlegr oups.com...
>
>
>
> - Show quoted text -
Russell,
Thanks as always. This is the perfect advice I need! I have a crazy
new contract and I am the developer/DBA etc and don't have time to
research etc.
Kristina

permissions for custom roles

I am on sql 2000 sp 4, windows 2003.
I am looking for a way to create custom database roles that are more
exacting than db_datareader, db_dbowner etc. What I need to do is to
create roles for the help desk personnel where they can view scheduled
jobs, but not edit them or create them. I also need to grant access to
edit DTS packages but not delete or create the. Does anyone have any
experience or good articles about this?
Thanks!
KristinaKristina,
Did you already get help through googlegroups? A couple of simple things on
SQL Server 2000.
Make those who should monitor jobs and schedules but not change them members
of the msdb TargetServersRole role. (Member of this role _cannot_ create new
jobs, so do not use this for someone who must also create jobs.)
Regarding DTS packages, I keep them stored on the file system, not in msdb.
Therefore, I control edit rights by giving the needed users Read access to
the DTS folders, but not Change rights.
RLF
"Kristina" <KristinaDBA@.gmail.com> wrote in message
news:1184982108.759067.184370@.r34g2000hsd.googlegroups.com...
>I am on sql 2000 sp 4, windows 2003.
> I am looking for a way to create custom database roles that are more
> exacting than db_datareader, db_dbowner etc. What I need to do is to
> create roles for the help desk personnel where they can view scheduled
> jobs, but not edit them or create them. I also need to grant access to
> edit DTS packages but not delete or create the. Does anyone have any
> experience or good articles about this?
> Thanks!
> Kristina
>|||On Jul 23, 10:44 am, "Russell Fields" <russellfie...@.nomail.com>
wrote:
> Kristina,
> Did you already get help through googlegroups? A couple of simple things
on
> SQL Server 2000.
> Make those who should monitor jobs and schedules but not change them membe
rs
> of the msdb TargetServersRole role. (Member of this role _cannot_ create n
ew
> jobs, so do not use this for someone who must also create jobs.)
> Regarding DTS packages, I keep them stored on the file system, not in msdb
.
> Therefore, I control edit rights by giving the needed users Read access to
> the DTS folders, but not Change rights.
> RLF"Kristina" <Kristina...@.gmail.com> wrote in message
> news:1184982108.759067.184370@.r34g2000hsd.googlegroups.com...
>
>
>
>
> - Show quoted text -
Russell,
Thanks as always. This is the perfect advice I need! I have a crazy
new contract and I am the developer/DBA etc and don't have time to
research etc.
Kristina

Wednesday, March 7, 2012

Permission Reading Registry from Assembly

======== REPOSTED w/MSDN ALIAS ======== We have a custom assembly used by our reports that needs to access SQL
Server and the Registry. In code, prior to making our SQL server
connection, we assert the System.Data.SqlClient.SqlClientPermission and we
are able to connect just fine. Prior to opening the registry key, we assert
the System.Security.Permissions.RegistryPermission, but on the subsequent
call to open the subkey, we get the following exception:
Request for the permission of type
System.Security.Permissions.RegistryPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
* We created a code group in the policy config file giving our assembly full
trust.
* The Everyone group has permissions to read the registry key and the value.
* We executed Sysinternal's registry monitor tool and it doesn't appear to
even log the call to open the key.
Environment: Visual Studio.NET 1.1, Reporting Services 1.1, Windows XP
====[BEGIN CODE SNIPPET]============== RegistryKey regTest = null;
try {
RegistryPermission regPermission = new
RegistryPermission(RegistryPermissionAccess.Read,
"HKEY_LOCAL_MACHINE\\SOFTWARE\\0");
regPermission.Assert();
regTest = Registry.LocalMachine;
regTest = regTest.OpenSubKey("SOFTWARE"); // This call fails with the
exception above
return (string)regTest.GetValue("TestVal");
} finally {
if (regTest != null) {
regTest.Close();
}
}
====[END CODE SNIPPET]==============
I don't think this is a registry permission issue since it says the
"request" for the permission failed. However, I would have expected the
request to fail on the assert, not on the subsequent OpenSubKey call.
Does anyone have any suggestions on how to troubleshoot this?
Thanks,
ChrisHi Chris,
Thank you for posting.
Regarding on the SSRS custom assembly registry accessing issue, I think we
should still troubleshoot from the permission setting. And what we can
check is the below things:
1. raw win32 registry access permission
2. .NET CAS permission setting.
For win32 registry access permission, the regmon tool should be able to
capture the failure error
For .NET CAS permission problem, you can consider temporarly turn off the
.net framework's CAS setting through the caspol.exe tool:
#Code Access Security Policy Tool (Caspol.exe) (.NET Framework)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/htm
l/cpgrfcodeaccesssecuritypolicyutilitycaspolexe.asp
After turn off the CAS and test the custom assembly again to see whether it
works.
Hope this helps.
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||I have copied code out of the help file that opens the LocalMachine key and
calls GetSubKeys(). This fails with the same permissions error. I have
granted the Everyone group Full Control on the LocalMachine key. Using the
caspol.exe tool noted below, I have turned off CAS.
I have been running registry monitor from system internals, and unless I'm
using the tool incorrectly, I don't see any failures or successes. I am
using the RSReportHost to be able to execute the report and step through my
assembly. I don't know what process it would be using to access the
registry.
In regards to the suggestions below:
1. What other pemissions could I add in addition to granting the Everyone
group Full Control? I am still getting the exception.
2. As stated above, I executed the caspol.exe turning off CAS. I am still
getting the exception.
- Chris
=================================Taken from the Registry.LocalMachine field help file sample:
public static string PrintKeys() {
StringBuilder sbResult = new StringBuilder();
RegistryKey rk = Registry.LocalMachine;
// Retrieve all the subkeys for the specified key.
String [] names;
try {
names = rk.GetSubKeyNames(); <=== BOOM
} catch (Exception e) {
return e.Message;
}
int icount = 0;
// Print the contents of the array to the console.
foreach (String s in names) {
sbResult.Append(s);
// The following code puts a limit on the number
// of keys displayed. Comment it out to print the
// complete list.
icount++;
if (icount >= 10)
break;
}
return sbResult.ToString();
}
"Steven Cheng[MSFT]" <stcheng@.online.microsoft.com> wrote in message
news:eeLJoQfWGHA.932@.TK2MSFTNGXA01.phx.gbl...
> Hi Chris,
> Thank you for posting.
> Regarding on the SSRS custom assembly registry accessing issue, I think we
> should still troubleshoot from the permission setting. And what we can
> check is the below things:
> 1. raw win32 registry access permission
> 2. .NET CAS permission setting.
> For win32 registry access permission, the regmon tool should be able to
> capture the failure error
> For .NET CAS permission problem, you can consider temporarly turn off the
> net framework's CAS setting through the caspol.exe tool:
> #Code Access Security Policy Tool (Caspol.exe) (.NET Framework)
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/htm
> l/cpgrfcodeaccesssecuritypolicyutilitycaspolexe.asp
> After turn off the CAS and test the custom assembly again to see whether
> it
> works.
> Hope this helps.
> Regards,
> Steven Cheng
> Microsoft Online Community Support
>
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>|||Clarification - When running the RegMon tool, I do see a lot of activity
from other processes, but nothing that I can identify being associated with
my custom assembly.
"Chris Walls" <chwalls2@.community.nospam> wrote in message
news:OIlWD$WXGHA.3492@.TK2MSFTNGP05.phx.gbl...
>I have copied code out of the help file that opens the LocalMachine key and
>calls GetSubKeys(). This fails with the same permissions error. I have
>granted the Everyone group Full Control on the LocalMachine key. Using the
>caspol.exe tool noted below, I have turned off CAS.
> I have been running registry monitor from system internals, and unless I'm
> using the tool incorrectly, I don't see any failures or successes. I am
> using the RSReportHost to be able to execute the report and step through
> my assembly. I don't know what process it would be using to access the
> registry.
> In regards to the suggestions below:
> 1. What other pemissions could I add in addition to granting the Everyone
> group Full Control? I am still getting the exception.
> 2. As stated above, I executed the caspol.exe turning off CAS. I am still
> getting the exception.
> - Chris
> =================================> Taken from the Registry.LocalMachine field help file sample:
> public static string PrintKeys() {
> StringBuilder sbResult = new StringBuilder();
> RegistryKey rk = Registry.LocalMachine;
> // Retrieve all the subkeys for the specified key.
> String [] names;
> try {
> names = rk.GetSubKeyNames(); <=== BOOM
> } catch (Exception e) {
> return e.Message;
> }
> int icount = 0;
> // Print the contents of the array to the console.
> foreach (String s in names) {
> sbResult.Append(s);
> // The following code puts a limit on the number
> // of keys displayed. Comment it out to print the
> // complete list.
> icount++;
> if (icount >= 10)
> break;
> }
> return sbResult.ToString();
> }
>
> "Steven Cheng[MSFT]" <stcheng@.online.microsoft.com> wrote in message
> news:eeLJoQfWGHA.932@.TK2MSFTNGXA01.phx.gbl...
>> Hi Chris,
>> Thank you for posting.
>> Regarding on the SSRS custom assembly registry accessing issue, I think
>> we
>> should still troubleshoot from the permission setting. And what we can
>> check is the below things:
>> 1. raw win32 registry access permission
>> 2. .NET CAS permission setting.
>> For win32 registry access permission, the regmon tool should be able to
>> capture the failure error
>> For .NET CAS permission problem, you can consider temporarly turn off the
>> net framework's CAS setting through the caspol.exe tool:
>> #Code Access Security Policy Tool (Caspol.exe) (.NET Framework)
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/htm
>> l/cpgrfcodeaccesssecuritypolicyutilitycaspolexe.asp
>> After turn off the CAS and test the custom assembly again to see whether
>> it
>> works.
>> Hope this helps.
>> Regards,
>> Steven Cheng
>> Microsoft Online Community Support
>>
>> ==================================================>> When responding to posts, please "Reply to Group" via your newsreader so
>> that others may learn and benefit from your issue.
>> ==================================================>>
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> Get Secure! www.microsoft.com/security
>> (This posting is provided "AS IS", with no warranties, and confers no
>> rights.)
>|||Thanks for your followup Chris,
This seems strange, so far I can not consider any other particular security
related setting either. Should be a environment specific issue. Have you
tried creating a new custom assembly which access some certain registry to
see whether it also suffer the probelm on ths machine?
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.|||I got a little further. I created a new assembly that only had my registry
code. I ran it as a console application and it successfully read my
registry values. I saw in RegMon that the keys where opened, queried, etc.
I then changed it to a class library and referenced it with a test report.
I was receiving the same permission errors. I turned off security via the
caspol utility and then I was able to successfully read my values. I then
modified my test report to reference my first assembly and it too now works.
Clearly I didn't disable security the last time like I thought I did.
So cleary my entries in the rspreviewpolicy.config file is incorrect. I
thought I was granting full trust to my assembly. Here is my entries. They
are at the end of the file just before the </policy> end tag.
<CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust"
Name="TSIRegistryTest">
<IMembershipCondition
class="UrlMembershipCondition"
version="1" Url="C:\Program Files\Microsoft SQL Server\80\Tools\Report
Designer\ReportTest.dll" />
</CodeGroup>
Any help would be greatly appreciated.
- Chris
"Steven Cheng[MSFT]" <stcheng@.online.microsoft.com> wrote in message
news:N9KImB8XGHA.888@.TK2MSFTNGXA01.phx.gbl...
> Thanks for your followup Chris,
> This seems strange, so far I can not consider any other particular
> security
> related setting either. Should be a environment specific issue. Have you
> tried creating a new custom assembly which access some certain registry to
> see whether it also suffer the probelm on ths machine?
> Regards,
> Steven Cheng
> Microsoft Online Community Support
>
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>|||Thank you for the response Chris,
So your custom assembly is put in the following location:
C:\Program Files\Microsoft SQL Server\80\Tools\Report
Designer\ReportTest.dll
If so, I think the <CodeGroup > element you pasted should be ok. And the
problem is possibly caused by the location where you add the custom
<codeGroup> in the policy file. As you mentioend that you add it at the
end of the file just before the </policy> end tag. Do you mean that it is
not included/nested within other <codeGroup> ?, like below:
======================...other code group here
<!--
Your code group here?
-->
</PolicyLevel>
</policy>
</security>
</mscorlib>
</configuration>
==========================
If so, it is not the correct place since the codegroup in .NET code access
policy file is not a flat structure, they're hierarchical and nested...
And our custom code should be put within a "Local Computer"
firstMatchCodeGroup, it is as below:
================= <CodeGroup
class="FirstMatchCodeGroup"
version="1"
PermissionSetName="Execution"
Description="This code group grants
MyComputer code Execution permission. ">
<IMembershipCondition
class="ZoneMembershipCondition"
version="1"
Zone="MyComputer" />
<!--
many parallel nested sub codegroups here....
-->
</CodeGroup>
==============
You'll find there is many other sub codegroups nested inside it which are
parallel with each other. If you find it, you can try puting your custom
code group as the sub nested codegroup within it. In addition, you can
also try strong-named your assembly and put it in GAC, then use
strong-named membershipCondition to idenitify it for testing.
BTW, here is a good msdn article describing the code access security in
ASP.NET application(including customizing policy file):
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html
/paght000017.asp
Hope this also helps.
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Ok, I think I got it. One thing that was screwing me up is that the change
in the rspreviewpolicy.config was not being picked up by the RSReportHost
utility, even when I unloaded and reloaded it. Only when I started
previewing the report with VS.NET did I see a successful execution with CAS
turned on. Now I'm having similar issues on the build server, but I have a
better understanding of how to troubleshoot it.
Thanks for all of the help.
- Chris
"Steven Cheng[MSFT]" <stcheng@.online.microsoft.com> wrote in message
news:J8C4%23YEZGHA.6000@.TK2MSFTNGXA01.phx.gbl...
> Thank you for the response Chris,
> So your custom assembly is put in the following location:
> C:\Program Files\Microsoft SQL Server\80\Tools\Report
> Designer\ReportTest.dll
> If so, I think the <CodeGroup > element you pasted should be ok. And the
> problem is possibly caused by the location where you add the custom
> <codeGroup> in the policy file. As you mentioend that you add it at the
> end of the file just before the </policy> end tag. Do you mean that it is
> not included/nested within other <codeGroup> ?, like below:
> ======================> ...other code group here
> <!--
> Your code group here?
> -->
> </PolicyLevel>
> </policy>
> </security>
> </mscorlib>
> </configuration>
> ==========================> If so, it is not the correct place since the codegroup in .NET code access
> policy file is not a flat structure, they're hierarchical and nested...
> And our custom code should be put within a "Local Computer"
> firstMatchCodeGroup, it is as below:
> =================> <CodeGroup
> class="FirstMatchCodeGroup"
> version="1"
> PermissionSetName="Execution"
> Description="This code group grants
> MyComputer code Execution permission. ">
> <IMembershipCondition
> class="ZoneMembershipCondition"
> version="1"
> Zone="MyComputer" />
> <!--
> many parallel nested sub codegroups here....
> -->
> </CodeGroup>
> ==============> You'll find there is many other sub codegroups nested inside it which are
> parallel with each other. If you find it, you can try puting your custom
> code group as the sub nested codegroup within it. In addition, you can
> also try strong-named your assembly and put it in GAC, then use
> strong-named membershipCondition to idenitify it for testing.
> BTW, here is a good msdn article describing the code access security in
> ASP.NET application(including customizing policy file):
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html
> /paght000017.asp
> Hope this also helps.
> Regards,
> Steven Cheng
> Microsoft Online Community Support
>
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
>
>
>
>
>
>|||Thanks for your followup Chris,
I'm very glad that you've made progress on this. Also, it's a pleasure to
be of assistance.
Please feel free to post here when there is anything else we can help you.
Good luck!
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Saturday, February 25, 2012

permission grant set is incompatible between appdomains

HI ,
I have a custom dll that I use to do some of the code expressions across
reports. I have set the required permissions in the rsrvpolicy.config file to
allow it to run under full trust. I have also set the following attributes
on the method in that dll
<System.Security.Permissions.EnvironmentPermission(Security.Permissions.SecurityAction.Assert, Unrestricted:=True),
System.Net.WebPermission(Security.Permissions.SecurityAction.Assert,
Unrestricted:=True)>
Everything was fine till yesterday. Yesterday, my machine was added to be a
member of a domain. I am not getting this error when I try to access the
reports:
rsProcessingError 400 Failed to load expression host assembly. Details:
Assembly mycustom.dll security permission grant set is incompatible between
appdomains.
http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings.resources.Strings&EvtID=rsProcessingError&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=8.00
Microsoft SQL Server Reporting Services 8.00.743.00 127 OsIndependent 1033
Microsoft.ReportingServices.Processing Failed to load expression host
assembly. Details: Assembly mycustom.dll security permission grant set is
incompatible between appdomains
Please help!Never mind.
I got some notes by searching in google that fixed this problem. I just had
to restart IIS.
and it starting working
Thanks
George

Monday, February 20, 2012

Permission editor?

Hi,
I wonder is there a tool for easy setting of custom permissions for user on
database. When i try to do this via the Enterprise Manager it shows all the
objects in the DB without any grouping so it's difficult set permissions.
For example if i want to give SELECT permissions on all tables but not to
give SELECT on the VIEWS and i want to give EXECUTE permission on all
functions i must go around the list and put check-s on the boxes manually.
Thanks in advance
Georgi Peshterski
I suggest you script your tasks instead of performing them from Enterprise
Manager. Take a look at
http://vyaskn.tripod.com/generate_sc..._sql_tasks.htm to find
some useful examples.
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Georgi Peshterski" <unseen@.mail.bg> wrote in message
news:%233VrKC2aFHA.3040@.TK2MSFTNGP14.phx.gbl...
Hi,
I wonder is there a tool for easy setting of custom permissions for user on
database. When i try to do this via the Enterprise Manager it shows all the
objects in the DB without any grouping so it's difficult set permissions.
For example if i want to give SELECT permissions on all tables but not to
give SELECT on the VIEWS and i want to give EXECUTE permission on all
functions i must go around the list and put check-s on the boxes manually.
Thanks in advance
Georgi Peshterski