Showing posts with label exception. Show all posts
Showing posts with label exception. Show all posts

Thursday, March 22, 2012

Compact 3.5 SP1 "LoadProperties()" Thows Exception

Hi all,
I have SQL Server 2008 (Nov. CTP) as a publisher and a SQL Server Compact
3.5 SP1 as a client for merge replication.
The Compact database has two subscriptions. The synchronization worked
perfectly many times. If I look at the Compact database in Management Studio
I can see my subscriptions in the Replication folder.
Everything looked so promising.....until I added a call to
"SqlCeReplication.LoadProperties()". At this point I see an error that simply
says, "Unhandled Exception: The subscription could not be loaded because it
was not saved.".
In doing some research it turns out this is error:
SSCE_M_SUBSCRIPTIOWASNOTSAVED
described here: http://technet.microsoft.com/en-us/library/ms172898.aspx
The web page indicates:
"If the error appears again, you should immediately contact Microsoft
Product Support Services. The internal errors cannot be resolved by common
troubleshooting techniques."
Which is why I am posting here. Hopefully someone from Microsoft can
respond. The relevant code is listed here:
SqlCeReplication repl = new SqlCeReplication();
repl.Publisher = @."AOS-LAPASO-4\AOS_1";
repl.PublisherDatabase = @."RepTest";
repl.SubscriberConnectionString = @."Data Source=""C:\test.sdf"";Max Database
Size=128;Default Lock Escalation =100;";
repl.Publication = @."TestPub";
Console.WriteLine("LoadProperties: " + repl.LoadProperties());
Thanks very much.
Tom Baxter
Hi Tom,
Appreciate your understanding that our MSDN newsgroups are not very good at
handling such issue since this issue is an internal error and dump analysis
would be required in this case. We recommended that you contact Microsoft
Product Support Services (PSS) via telephone so that a dedicated Support
professional can assist you in a more efficient manner. Please be advised
that contacting phone support will be a charged call.
To obtain the phone numbers for specific technology request please take a
look at the web site listed below.
http://support.microsoft.com/default.aspx?scid=fh;EN-US;PHONENUMBERS
If you are outside the US please see http://support.microsoft.com for
regional support phone numbers.
If you have any other questions or concerns, please feel free to let us
know. Have a good day!
Best regards,
Charles Wang
Microsoft Online Community Support
================================================== ===
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====
sql

Sunday, March 11, 2012

.net Security Exception

I am trying to access a stored proc from windows app (VS 2005 running on windows 2003 server).

The code is

SqlConnection conn = new SqlConnection(sCn);

SqlCommand command = new SqlCommand(sCmd, conn);

SqlDataAdapter adapter = new SqlDataAdapter(command);

DataSet ds = new DataSet();

adapter.Fill(ds, "Location");

this.dg.DataSource = ds;

this.dg.DataMember = "Location";

I get the following exception!!!

System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.PermissionSet.Demand()
at System.Data.Common.DbConnectionOptions.DemandPermission()
at System.Data.SqlClient.SqlConnection.PermissionDemand()
at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
at WindowsApplication1.Form1.Form1_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Data.SqlClient.SqlClientPermission
The Zone of the assembly that failed was:
Internet

What am I doing wrong?

Thanks

SqlCommand command = new SqlCommand(sCmd, conn);

SqlDataAdapter adapter = new SqlDataAdapter(command);

what exactly is command refering to?

Secondly, if it's refering to a networked application, you probably have to publish the assemblies via caspol on the server.

Based on the error, you need to add a key for the Internet codebase.

Thursday, March 8, 2012

.NET exception whenn calling CLR user-defined functions

hello together!
currently we are developing a server database which is using an assembly
with some very simple clr-functions (eg check regular expression or
converting local time to universal time).
from some indefinite time we receive the following errormessage each time
calling such a clr-function:
Msg 10314, Level 16, State 11, Line 1
An error occurred in the Microsoft .NET Framework while trying to load
assembly id 65706. The server may be running out of resources, or the
assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE.
Run the query again, or check documentation to see how to solve the assembly
trust issues. For more information about this error:
System.IO.FileNotFoundException: Could not load file or assembly
'myassembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of
its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&
stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
the only way to get the assembly working again is to restart the sql server
engine or the whole server.
sometimes even multiple restarts are needed.
we tried several things to get rid of this message but without any access:
- drop and re-create the assembly and all functions in the database (with
visual studio deployment, with t-sql statements loading the assembly from a
file or in binary)
- change of the assembly permission_set according to the error message (even
there is no external access or unsafe code - there is even no database access
at all)
- restrict the maximum server memory at the server options
- we already tried to setup the whole database on a complete different
independent server with a complete fresh sql server installation
- update the sql server with service pack 1
- building the assembly with platform x64 instead of any cpu
configuration of our two test systems
- WIN2003 SP1 ENT + SQL2005 STD X64 RTM clustered
- WIN2003 SP1 ENT + SQL2005 DEV X64 SP1 single
any ideas or recommendation regarding this problem? - thanks in advance
mike s.Hi Mike,
This error can happen when the database has been detached and attached onto
a different server and SQL Server is unable to find the correct login
associated with the dbo for that database. If this is the case for you,
then you can fix the problem by using sp_changedbowner to reassociate dbo
with a valid login like so: exec sp_changedbowner 'sa'. Making the error
message more clear is on track to be fixed in a future service pack. Hope
this helps.
Steven
"FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
news:537F22F0-200F-4D1C-96AD-E7A211C75644@.microsoft.com...
> hello together!
> currently we are developing a server database which is using an assembly
> with some very simple clr-functions (eg check regular expression or
> converting local time to universal time).
> from some indefinite time we receive the following errormessage each time
> calling such a clr-function:
> Msg 10314, Level 16, State 11, Line 1
> An error occurred in the Microsoft .NET Framework while trying to load
> assembly id 65706. The server may be running out of resources, or the
> assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or
> UNSAFE.
> Run the query again, or check documentation to see how to solve the
> assembly
> trust issues. For more information about this error:
> System.IO.FileNotFoundException: Could not load file or assembly
> 'myassembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one
> of
> its dependencies. The system cannot find the file specified.
> System.IO.FileNotFoundException:
> at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
> codeBase, Evidence assemblySecurity, Assembly locationHint,
> StackCrawlMark&
> stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
> at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
> Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
> forIntrospection)
> at System.Reflection.Assembly.InternalLoad(String assemblyString,
> Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
> forIntrospection)
> at System.Reflection.Assembly.Load(String assemblyString)
> the only way to get the assembly working again is to restart the sql
> server
> engine or the whole server.
> sometimes even multiple restarts are needed.
> we tried several things to get rid of this message but without any access:
> - drop and re-create the assembly and all functions in the database (with
> visual studio deployment, with t-sql statements loading the assembly from
> a
> file or in binary)
> - change of the assembly permission_set according to the error message
> (even
> there is no external access or unsafe code - there is even no database
> access
> at all)
> - restrict the maximum server memory at the server options
> - we already tried to setup the whole database on a complete different
> independent server with a complete fresh sql server installation
> - update the sql server with service pack 1
> - building the assembly with platform x64 instead of any cpu
> configuration of our two test systems
> - WIN2003 SP1 ENT + SQL2005 STD X64 RTM clustered
> - WIN2003 SP1 ENT + SQL2005 DEV X64 SP1 single
> any ideas or recommendation regarding this problem? - thanks in advance
> mike s.|||hi steven,
first many thanks for your quick response and support!
you're right the database has been detached and attached on different
servers during development many times
can i check this case with the system catalog views?
when i take a look at the sys.databases catalog view the owner_sid is 0x01 -
according to the sys.server_principals and sys.database_principals views the
sid 0x01 belongs to the login sa and the user dbo
anyway i will try to change the dbo according to your statement and hope
that this error won't occur in the future
thanks again,
mike s.
"Steven Hemingray [MSFT]" wrote:
> Hi Mike,
> This error can happen when the database has been detached and attached onto
> a different server and SQL Server is unable to find the correct login
> associated with the dbo for that database. If this is the case for you,
> then you can fix the problem by using sp_changedbowner to reassociate dbo
> with a valid login like so: exec sp_changedbowner 'sa'. Making the error
> message more clear is on track to be fixed in a future service pack. Hope
> this helps.
> Steven
>
> "FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
> news:537F22F0-200F-4D1C-96AD-E7A211C75644@.microsoft.com...
> > hello together!
> > currently we are developing a server database which is using an assembly
> > with some very simple clr-functions (eg check regular expression or
> > converting local time to universal time).
> > from some indefinite time we receive the following errormessage each time
> > calling such a clr-function:
> >
> > Msg 10314, Level 16, State 11, Line 1
> > An error occurred in the Microsoft .NET Framework while trying to load
> > assembly id 65706. The server may be running out of resources, or the
> > assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or
> > UNSAFE.
> > Run the query again, or check documentation to see how to solve the
> > assembly
> > trust issues. For more information about this error:
> > System.IO.FileNotFoundException: Could not load file or assembly
> > 'myassembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one
> > of
> > its dependencies. The system cannot find the file specified.
> > System.IO.FileNotFoundException:
> > at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
> > codeBase, Evidence assemblySecurity, Assembly locationHint,
> > StackCrawlMark&
> > stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
> > at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
> > Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
> > forIntrospection)
> > at System.Reflection.Assembly.InternalLoad(String assemblyString,
> > Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
> > forIntrospection)
> > at System.Reflection.Assembly.Load(String assemblyString)
> >
> > the only way to get the assembly working again is to restart the sql
> > server
> > engine or the whole server.
> > sometimes even multiple restarts are needed.
> >
> > we tried several things to get rid of this message but without any access:
> > - drop and re-create the assembly and all functions in the database (with
> > visual studio deployment, with t-sql statements loading the assembly from
> > a
> > file or in binary)
> > - change of the assembly permission_set according to the error message
> > (even
> > there is no external access or unsafe code - there is even no database
> > access
> > at all)
> > - restrict the maximum server memory at the server options
> > - we already tried to setup the whole database on a complete different
> > independent server with a complete fresh sql server installation
> > - update the sql server with service pack 1
> > - building the assembly with platform x64 instead of any cpu
> >
> > configuration of our two test systems
> > - WIN2003 SP1 ENT + SQL2005 STD X64 RTM clustered
> > - WIN2003 SP1 ENT + SQL2005 DEV X64 SP1 single
> >
> > any ideas or recommendation regarding this problem? - thanks in advance
> > mike s.
>
>|||hi again,
after changing the dbo like you describe above it only takes some hours and
now the error occurs again
any other ideas or suggestions?
thanks in advance,
mike
"FwMsdn" wrote:
> hi steven,
> first many thanks for your quick response and support!
> you're right the database has been detached and attached on different
> servers during development many times
> can i check this case with the system catalog views?
> when i take a look at the sys.databases catalog view the owner_sid is 0x01 -
> according to the sys.server_principals and sys.database_principals views the
> sid 0x01 belongs to the login sa and the user dbo
> anyway i will try to change the dbo according to your statement and hope
> that this error won't occur in the future
> thanks again,
> mike s.
> "Steven Hemingray [MSFT]" wrote:
> > Hi Mike,
> >
> > This error can happen when the database has been detached and attached onto
> > a different server and SQL Server is unable to find the correct login
> > associated with the dbo for that database. If this is the case for you,
> > then you can fix the problem by using sp_changedbowner to reassociate dbo
> > with a valid login like so: exec sp_changedbowner 'sa'. Making the error
> > message more clear is on track to be fixed in a future service pack. Hope
> > this helps.
> >
> > Steven
> >
> >
> > "FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
> > news:537F22F0-200F-4D1C-96AD-E7A211C75644@.microsoft.com...
> > > hello together!
> > > currently we are developing a server database which is using an assembly
> > > with some very simple clr-functions (eg check regular expression or
> > > converting local time to universal time).
> > > from some indefinite time we receive the following errormessage each time
> > > calling such a clr-function:
> > >
> > > Msg 10314, Level 16, State 11, Line 1
> > > An error occurred in the Microsoft .NET Framework while trying to load
> > > assembly id 65706. The server may be running out of resources, or the
> > > assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or
> > > UNSAFE.
> > > Run the query again, or check documentation to see how to solve the
> > > assembly
> > > trust issues. For more information about this error:
> > > System.IO.FileNotFoundException: Could not load file or assembly
> > > 'myassembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one
> > > of
> > > its dependencies. The system cannot find the file specified.
> > > System.IO.FileNotFoundException:
> > > at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
> > > codeBase, Evidence assemblySecurity, Assembly locationHint,
> > > StackCrawlMark&
> > > stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
> > > at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
> > > Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
> > > forIntrospection)
> > > at System.Reflection.Assembly.InternalLoad(String assemblyString,
> > > Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
> > > forIntrospection)
> > > at System.Reflection.Assembly.Load(String assemblyString)
> > >
> > > the only way to get the assembly working again is to restart the sql
> > > server
> > > engine or the whole server.
> > > sometimes even multiple restarts are needed.
> > >
> > > we tried several things to get rid of this message but without any access:
> > > - drop and re-create the assembly and all functions in the database (with
> > > visual studio deployment, with t-sql statements loading the assembly from
> > > a
> > > file or in binary)
> > > - change of the assembly permission_set according to the error message
> > > (even
> > > there is no external access or unsafe code - there is even no database
> > > access
> > > at all)
> > > - restrict the maximum server memory at the server options
> > > - we already tried to setup the whole database on a complete different
> > > independent server with a complete fresh sql server installation
> > > - update the sql server with service pack 1
> > > - building the assembly with platform x64 instead of any cpu
> > >
> > > configuration of our two test systems
> > > - WIN2003 SP1 ENT + SQL2005 STD X64 RTM clustered
> > > - WIN2003 SP1 ENT + SQL2005 DEV X64 SP1 single
> > >
> > > any ideas or recommendation regarding this problem? - thanks in advance
> > > mike s.
> >
> >
> >|||The way to check for the problem is to see if the owner_sid in sys.databases
does not match the sid for dbo in sys.database_principals.
use YOUR_DATABASE
go
select d.name, dp.name, d.owner_sid, dp.sid from sys.databases d,
sys.database_principals dp where d.owner_sid = dp.sid and dp.name = 'dbo'
and d.name = 'YOUR_DATABASE'
If you're still seeing this problem and the above query indicates that the
sids match, then it must be a different problem and I'd have to do some
investigation on what else could cause this to fail repeatedly and on
different independent servers.
Steven
"FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
news:EB0942FA-39B3-4590-B7F8-73D59A1A0794@.microsoft.com...
> hi again,
> after changing the dbo like you describe above it only takes some hours
> and
> now the error occurs again
> any other ideas or suggestions?
> thanks in advance,
> mike
> "FwMsdn" wrote:
>> hi steven,
>> first many thanks for your quick response and support!
>> you're right the database has been detached and attached on different
>> servers during development many times
>> can i check this case with the system catalog views?
>> when i take a look at the sys.databases catalog view the owner_sid is
>> 0x01 -
>> according to the sys.server_principals and sys.database_principals views
>> the
>> sid 0x01 belongs to the login sa and the user dbo
>> anyway i will try to change the dbo according to your statement and hope
>> that this error won't occur in the future
>> thanks again,
>> mike s.
>> "Steven Hemingray [MSFT]" wrote:
>> > Hi Mike,
>> >
>> > This error can happen when the database has been detached and attached
>> > onto
>> > a different server and SQL Server is unable to find the correct login
>> > associated with the dbo for that database. If this is the case for
>> > you,
>> > then you can fix the problem by using sp_changedbowner to reassociate
>> > dbo
>> > with a valid login like so: exec sp_changedbowner 'sa'. Making the
>> > error
>> > message more clear is on track to be fixed in a future service pack.
>> > Hope
>> > this helps.
>> >
>> > Steven
>> >
>> >
>> > "FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
>> > news:537F22F0-200F-4D1C-96AD-E7A211C75644@.microsoft.com...
>> > > hello together!
>> > > currently we are developing a server database which is using an
>> > > assembly
>> > > with some very simple clr-functions (eg check regular expression or
>> > > converting local time to universal time).
>> > > from some indefinite time we receive the following errormessage each
>> > > time
>> > > calling such a clr-function:
>> > >
>> > > Msg 10314, Level 16, State 11, Line 1
>> > > An error occurred in the Microsoft .NET Framework while trying to
>> > > load
>> > > assembly id 65706. The server may be running out of resources, or the
>> > > assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or
>> > > UNSAFE.
>> > > Run the query again, or check documentation to see how to solve the
>> > > assembly
>> > > trust issues. For more information about this error:
>> > > System.IO.FileNotFoundException: Could not load file or assembly
>> > > 'myassembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
>> > > or one
>> > > of
>> > > its dependencies. The system cannot find the file specified.
>> > > System.IO.FileNotFoundException:
>> > > at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
>> > > codeBase, Evidence assemblySecurity, Assembly locationHint,
>> > > StackCrawlMark&
>> > > stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
>> > > at System.Reflection.Assembly.InternalLoad(AssemblyName
>> > > assemblyRef,
>> > > Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
>> > > forIntrospection)
>> > > at System.Reflection.Assembly.InternalLoad(String assemblyString,
>> > > Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
>> > > forIntrospection)
>> > > at System.Reflection.Assembly.Load(String assemblyString)
>> > >
>> > > the only way to get the assembly working again is to restart the sql
>> > > server
>> > > engine or the whole server.
>> > > sometimes even multiple restarts are needed.
>> > >
>> > > we tried several things to get rid of this message but without any
>> > > access:
>> > > - drop and re-create the assembly and all functions in the database
>> > > (with
>> > > visual studio deployment, with t-sql statements loading the assembly
>> > > from
>> > > a
>> > > file or in binary)
>> > > - change of the assembly permission_set according to the error
>> > > message
>> > > (even
>> > > there is no external access or unsafe code - there is even no
>> > > database
>> > > access
>> > > at all)
>> > > - restrict the maximum server memory at the server options
>> > > - we already tried to setup the whole database on a complete
>> > > different
>> > > independent server with a complete fresh sql server installation
>> > > - update the sql server with service pack 1
>> > > - building the assembly with platform x64 instead of any cpu
>> > >
>> > > configuration of our two test systems
>> > > - WIN2003 SP1 ENT + SQL2005 STD X64 RTM clustered
>> > > - WIN2003 SP1 ENT + SQL2005 DEV X64 SP1 single
>> > >
>> > > any ideas or recommendation regarding this problem? - thanks in
>> > > advance
>> > > mike s.
>> >
>> >
>> >|||hi steven,
as mentioned in an earlier post the dbo mapping seems to be ok (according to
the system catalog views)
here is the result of your statement similar to my query
Name name owner_sid sid
Core dbo 0x01 0x01
what else can i try?
mike
"Steven Hemingray [MSFT]" wrote:
> The way to check for the problem is to see if the owner_sid in sys.databases
> does not match the sid for dbo in sys.database_principals.
> use YOUR_DATABASE
> go
> select d.name, dp.name, d.owner_sid, dp.sid from sys.databases d,
> sys.database_principals dp where d.owner_sid = dp.sid and dp.name = 'dbo'
> and d.name = 'YOUR_DATABASE'
> If you're still seeing this problem and the above query indicates that the
> sids match, then it must be a different problem and I'd have to do some
> investigation on what else could cause this to fail repeatedly and on
> different independent servers.
> Steven
>
> "FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
> news:EB0942FA-39B3-4590-B7F8-73D59A1A0794@.microsoft.com...
> > hi again,
> >
> > after changing the dbo like you describe above it only takes some hours
> > and
> > now the error occurs again
> > any other ideas or suggestions?
> >
> > thanks in advance,
> > mike
> >
> > "FwMsdn" wrote:
> >
> >> hi steven,
> >> first many thanks for your quick response and support!
> >>
> >> you're right the database has been detached and attached on different
> >> servers during development many times
> >>
> >> can i check this case with the system catalog views?
> >> when i take a look at the sys.databases catalog view the owner_sid is
> >> 0x01 -
> >> according to the sys.server_principals and sys.database_principals views
> >> the
> >> sid 0x01 belongs to the login sa and the user dbo
> >>
> >> anyway i will try to change the dbo according to your statement and hope
> >> that this error won't occur in the future
> >>
> >> thanks again,
> >> mike s.
> >>
> >> "Steven Hemingray [MSFT]" wrote:
> >>
> >> > Hi Mike,
> >> >
> >> > This error can happen when the database has been detached and attached
> >> > onto
> >> > a different server and SQL Server is unable to find the correct login
> >> > associated with the dbo for that database. If this is the case for
> >> > you,
> >> > then you can fix the problem by using sp_changedbowner to reassociate
> >> > dbo
> >> > with a valid login like so: exec sp_changedbowner 'sa'. Making the
> >> > error
> >> > message more clear is on track to be fixed in a future service pack.
> >> > Hope
> >> > this helps.
> >> >
> >> > Steven
> >> >
> >> >
> >> > "FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
> >> > news:537F22F0-200F-4D1C-96AD-E7A211C75644@.microsoft.com...
> >> > > hello together!
> >> > > currently we are developing a server database which is using an
> >> > > assembly
> >> > > with some very simple clr-functions (eg check regular expression or
> >> > > converting local time to universal time).
> >> > > from some indefinite time we receive the following errormessage each
> >> > > time
> >> > > calling such a clr-function:
> >> > >
> >> > > Msg 10314, Level 16, State 11, Line 1
> >> > > An error occurred in the Microsoft .NET Framework while trying to
> >> > > load
> >> > > assembly id 65706. The server may be running out of resources, or the
> >> > > assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or
> >> > > UNSAFE.
> >> > > Run the query again, or check documentation to see how to solve the
> >> > > assembly
> >> > > trust issues. For more information about this error:
> >> > > System.IO.FileNotFoundException: Could not load file or assembly
> >> > > 'myassembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
> >> > > or one
> >> > > of
> >> > > its dependencies. The system cannot find the file specified.
> >> > > System.IO.FileNotFoundException:
> >> > > at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
> >> > > codeBase, Evidence assemblySecurity, Assembly locationHint,
> >> > > StackCrawlMark&
> >> > > stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
> >> > > at System.Reflection.Assembly.InternalLoad(AssemblyName
> >> > > assemblyRef,
> >> > > Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
> >> > > forIntrospection)
> >> > > at System.Reflection.Assembly.InternalLoad(String assemblyString,
> >> > > Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
> >> > > forIntrospection)
> >> > > at System.Reflection.Assembly.Load(String assemblyString)
> >> > >
> >> > > the only way to get the assembly working again is to restart the sql
> >> > > server
> >> > > engine or the whole server.
> >> > > sometimes even multiple restarts are needed.
> >> > >
> >> > > we tried several things to get rid of this message but without any
> >> > > access:
> >> > > - drop and re-create the assembly and all functions in the database
> >> > > (with
> >> > > visual studio deployment, with t-sql statements loading the assembly
> >> > > from
> >> > > a
> >> > > file or in binary)
> >> > > - change of the assembly permission_set according to the error
> >> > > message
> >> > > (even
> >> > > there is no external access or unsafe code - there is even no
> >> > > database
> >> > > access
> >> > > at all)
> >> > > - restrict the maximum server memory at the server options
> >> > > - we already tried to setup the whole database on a complete
> >> > > different
> >> > > independent server with a complete fresh sql server installation
> >> > > - update the sql server with service pack 1
> >> > > - building the assembly with platform x64 instead of any cpu
> >> > >
> >> > > configuration of our two test systems
> >> > > - WIN2003 SP1 ENT + SQL2005 STD X64 RTM clustered
> >> > > - WIN2003 SP1 ENT + SQL2005 DEV X64 SP1 single
> >> > >
> >> > > any ideas or recommendation regarding this problem? - thanks in
> >> > > advance
> >> > > mike s.
> >> >
> >> >
> >> >
>
>|||I'm not sure what else could be causing this problem to reproduce
consistently - it doesn't sound like it could be a resource problem if it
reproduces this frequently and the most likely resource issue, Virtual
Address Space, is not an issue on x64.
Can you recreate the problem by loading the same assembly into a brand new
database?
If you're able to detach the send me the database when it's in a state that
exhibits the problem I can investigate further: stevehem at microsoft dot
com.
Steven
"FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
news:9EAE99EF-1DB2-47A8-BF6C-1921ED423A9A@.microsoft.com...
> hi steven,
> as mentioned in an earlier post the dbo mapping seems to be ok (according
> to
> the system catalog views)
> here is the result of your statement similar to my query
> Name name owner_sid sid
> Core dbo 0x01 0x01
> what else can i try?
> mike
> "Steven Hemingray [MSFT]" wrote:
>> The way to check for the problem is to see if the owner_sid in
>> sys.databases
>> does not match the sid for dbo in sys.database_principals.
>> use YOUR_DATABASE
>> go
>> select d.name, dp.name, d.owner_sid, dp.sid from sys.databases d,
>> sys.database_principals dp where d.owner_sid = dp.sid and dp.name = 'dbo'
>> and d.name = 'YOUR_DATABASE'
>> If you're still seeing this problem and the above query indicates that
>> the
>> sids match, then it must be a different problem and I'd have to do some
>> investigation on what else could cause this to fail repeatedly and on
>> different independent servers.
>> Steven
>>
>> "FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
>> news:EB0942FA-39B3-4590-B7F8-73D59A1A0794@.microsoft.com...
>> > hi again,
>> >
>> > after changing the dbo like you describe above it only takes some hours
>> > and
>> > now the error occurs again
>> > any other ideas or suggestions?
>> >
>> > thanks in advance,
>> > mike
>> >
>> > "FwMsdn" wrote:
>> >
>> >> hi steven,
>> >> first many thanks for your quick response and support!
>> >>
>> >> you're right the database has been detached and attached on different
>> >> servers during development many times
>> >>
>> >> can i check this case with the system catalog views?
>> >> when i take a look at the sys.databases catalog view the owner_sid is
>> >> 0x01 -
>> >> according to the sys.server_principals and sys.database_principals
>> >> views
>> >> the
>> >> sid 0x01 belongs to the login sa and the user dbo
>> >>
>> >> anyway i will try to change the dbo according to your statement and
>> >> hope
>> >> that this error won't occur in the future
>> >>
>> >> thanks again,
>> >> mike s.
>> >>
>> >> "Steven Hemingray [MSFT]" wrote:
>> >>
>> >> > Hi Mike,
>> >> >
>> >> > This error can happen when the database has been detached and
>> >> > attached
>> >> > onto
>> >> > a different server and SQL Server is unable to find the correct
>> >> > login
>> >> > associated with the dbo for that database. If this is the case for
>> >> > you,
>> >> > then you can fix the problem by using sp_changedbowner to
>> >> > reassociate
>> >> > dbo
>> >> > with a valid login like so: exec sp_changedbowner 'sa'. Making the
>> >> > error
>> >> > message more clear is on track to be fixed in a future service pack.
>> >> > Hope
>> >> > this helps.
>> >> >
>> >> > Steven
>> >> >
>> >> >
>> >> > "FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
>> >> > news:537F22F0-200F-4D1C-96AD-E7A211C75644@.microsoft.com...
>> >> > > hello together!
>> >> > > currently we are developing a server database which is using an
>> >> > > assembly
>> >> > > with some very simple clr-functions (eg check regular expression
>> >> > > or
>> >> > > converting local time to universal time).
>> >> > > from some indefinite time we receive the following errormessage
>> >> > > each
>> >> > > time
>> >> > > calling such a clr-function:
>> >> > >
>> >> > > Msg 10314, Level 16, State 11, Line 1
>> >> > > An error occurred in the Microsoft .NET Framework while trying to
>> >> > > load
>> >> > > assembly id 65706. The server may be running out of resources, or
>> >> > > the
>> >> > > assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS
>> >> > > or
>> >> > > UNSAFE.
>> >> > > Run the query again, or check documentation to see how to solve
>> >> > > the
>> >> > > assembly
>> >> > > trust issues. For more information about this error:
>> >> > > System.IO.FileNotFoundException: Could not load file or assembly
>> >> > > 'myassembly, Version=0.0.0.0, Culture=neutral,
>> >> > > PublicKeyToken=null'
>> >> > > or one
>> >> > > of
>> >> > > its dependencies. The system cannot find the file specified.
>> >> > > System.IO.FileNotFoundException:
>> >> > > at System.Reflection.Assembly.nLoad(AssemblyName fileName,
>> >> > > String
>> >> > > codeBase, Evidence assemblySecurity, Assembly locationHint,
>> >> > > StackCrawlMark&
>> >> > > stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
>> >> > > at System.Reflection.Assembly.InternalLoad(AssemblyName
>> >> > > assemblyRef,
>> >> > > Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
>> >> > > forIntrospection)
>> >> > > at System.Reflection.Assembly.InternalLoad(String
>> >> > > assemblyString,
>> >> > > Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
>> >> > > forIntrospection)
>> >> > > at System.Reflection.Assembly.Load(String assemblyString)
>> >> > >
>> >> > > the only way to get the assembly working again is to restart the
>> >> > > sql
>> >> > > server
>> >> > > engine or the whole server.
>> >> > > sometimes even multiple restarts are needed.
>> >> > >
>> >> > > we tried several things to get rid of this message but without any
>> >> > > access:
>> >> > > - drop and re-create the assembly and all functions in the
>> >> > > database
>> >> > > (with
>> >> > > visual studio deployment, with t-sql statements loading the
>> >> > > assembly
>> >> > > from
>> >> > > a
>> >> > > file or in binary)
>> >> > > - change of the assembly permission_set according to the error
>> >> > > message
>> >> > > (even
>> >> > > there is no external access or unsafe code - there is even no
>> >> > > database
>> >> > > access
>> >> > > at all)
>> >> > > - restrict the maximum server memory at the server options
>> >> > > - we already tried to setup the whole database on a complete
>> >> > > different
>> >> > > independent server with a complete fresh sql server installation
>> >> > > - update the sql server with service pack 1
>> >> > > - building the assembly with platform x64 instead of any cpu
>> >> > >
>> >> > > configuration of our two test systems
>> >> > > - WIN2003 SP1 ENT + SQL2005 STD X64 RTM clustered
>> >> > > - WIN2003 SP1 ENT + SQL2005 DEV X64 SP1 single
>> >> > >
>> >> > > any ideas or recommendation regarding this problem? - thanks in
>> >> > > advance
>> >> > > mike s.
>> >> >
>> >> >
>> >> >
>>|||hi steven,
first i tried to reproduce the error message in a new created, blank
database - but without production load i wasn't able the reach the state
so i tried to delete unnecessary data and detach the real database, but
after attaching the database again, the assembly works fine again
in the meantime i also found a solution to get the assembly working again
without restarting the server - after disabling and enabling the whole clr
integration with the following statement the assembly works again
sp_configure 'clr enabled', 0
GO
RECONFIGURE
GO
sp_configure 'clr enabled', 1
GO
RECONFIGURE
GO
according to the documentation this statement issues unloading of all
appdomains - after re-creating the appdomains the assembly works again
i also noticed the following behaviour in the sql server log:
first everything works fine - sometimes after the following messages in the
sql server log the assembly throws the exception each time a function is
called
- AppDomain 23 (Core.dbo[runtime].22) is marked for unload due to memory
pressure.
- AppDomain 23 (Core.dbo[runtime].22) unloaded.
- AppDomain 24 (Core.dbo[runtime].23) created.
hope this information is useful for you
should i send you more information? i also found some clr related dynamic
management views
again thanks for your great support
mike
"Steven Hemingray [MSFT]" wrote:
> I'm not sure what else could be causing this problem to reproduce
> consistently - it doesn't sound like it could be a resource problem if it
> reproduces this frequently and the most likely resource issue, Virtual
> Address Space, is not an issue on x64.
> Can you recreate the problem by loading the same assembly into a brand new
> database?
> If you're able to detach the send me the database when it's in a state that
> exhibits the problem I can investigate further: stevehem at microsoft dot
> com.
> Steven
>
> "FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
> news:9EAE99EF-1DB2-47A8-BF6C-1921ED423A9A@.microsoft.com...
> > hi steven,
> > as mentioned in an earlier post the dbo mapping seems to be ok (according
> > to
> > the system catalog views)
> > here is the result of your statement similar to my query
> > Name name owner_sid sid
> > Core dbo 0x01 0x01
> >
> > what else can i try?
> > mike
> >
> > "Steven Hemingray [MSFT]" wrote:
> >
> >> The way to check for the problem is to see if the owner_sid in
> >> sys.databases
> >> does not match the sid for dbo in sys.database_principals.
> >>
> >> use YOUR_DATABASE
> >> go
> >> select d.name, dp.name, d.owner_sid, dp.sid from sys.databases d,
> >> sys.database_principals dp where d.owner_sid = dp.sid and dp.name = 'dbo'
> >> and d.name = 'YOUR_DATABASE'
> >>
> >> If you're still seeing this problem and the above query indicates that
> >> the
> >> sids match, then it must be a different problem and I'd have to do some
> >> investigation on what else could cause this to fail repeatedly and on
> >> different independent servers.
> >>
> >> Steven
> >>
> >>
> >> "FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
> >> news:EB0942FA-39B3-4590-B7F8-73D59A1A0794@.microsoft.com...
> >> > hi again,
> >> >
> >> > after changing the dbo like you describe above it only takes some hours
> >> > and
> >> > now the error occurs again
> >> > any other ideas or suggestions?
> >> >
> >> > thanks in advance,
> >> > mike
> >> >
> >> > "FwMsdn" wrote:
> >> >
> >> >> hi steven,
> >> >> first many thanks for your quick response and support!
> >> >>
> >> >> you're right the database has been detached and attached on different
> >> >> servers during development many times
> >> >>
> >> >> can i check this case with the system catalog views?
> >> >> when i take a look at the sys.databases catalog view the owner_sid is
> >> >> 0x01 -
> >> >> according to the sys.server_principals and sys.database_principals
> >> >> views
> >> >> the
> >> >> sid 0x01 belongs to the login sa and the user dbo
> >> >>
> >> >> anyway i will try to change the dbo according to your statement and
> >> >> hope
> >> >> that this error won't occur in the future
> >> >>
> >> >> thanks again,
> >> >> mike s.
> >> >>
> >> >> "Steven Hemingray [MSFT]" wrote:
> >> >>
> >> >> > Hi Mike,
> >> >> >
> >> >> > This error can happen when the database has been detached and
> >> >> > attached
> >> >> > onto
> >> >> > a different server and SQL Server is unable to find the correct
> >> >> > login
> >> >> > associated with the dbo for that database. If this is the case for
> >> >> > you,
> >> >> > then you can fix the problem by using sp_changedbowner to
> >> >> > reassociate
> >> >> > dbo
> >> >> > with a valid login like so: exec sp_changedbowner 'sa'. Making the
> >> >> > error
> >> >> > message more clear is on track to be fixed in a future service pack.
> >> >> > Hope
> >> >> > this helps.
> >> >> >
> >> >> > Steven
> >> >> >
> >> >> >
> >> >> > "FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
> >> >> > news:537F22F0-200F-4D1C-96AD-E7A211C75644@.microsoft.com...
> >> >> > > hello together!
> >> >> > > currently we are developing a server database which is using an
> >> >> > > assembly
> >> >> > > with some very simple clr-functions (eg check regular expression
> >> >> > > or
> >> >> > > converting local time to universal time).
> >> >> > > from some indefinite time we receive the following errormessage
> >> >> > > each
> >> >> > > time
> >> >> > > calling such a clr-function:
> >> >> > >
> >> >> > > Msg 10314, Level 16, State 11, Line 1
> >> >> > > An error occurred in the Microsoft .NET Framework while trying to
> >> >> > > load
> >> >> > > assembly id 65706. The server may be running out of resources, or
> >> >> > > the
> >> >> > > assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS
> >> >> > > or
> >> >> > > UNSAFE.
> >> >> > > Run the query again, or check documentation to see how to solve
> >> >> > > the
> >> >> > > assembly
> >> >> > > trust issues. For more information about this error:
> >> >> > > System.IO.FileNotFoundException: Could not load file or assembly
> >> >> > > 'myassembly, Version=0.0.0.0, Culture=neutral,
> >> >> > > PublicKeyToken=null'
> >> >> > > or one
> >> >> > > of
> >> >> > > its dependencies. The system cannot find the file specified.
> >> >> > > System.IO.FileNotFoundException:
> >> >> > > at System.Reflection.Assembly.nLoad(AssemblyName fileName,
> >> >> > > String
> >> >> > > codeBase, Evidence assemblySecurity, Assembly locationHint,
> >> >> > > StackCrawlMark&
> >> >> > > stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
> >> >> > > at System.Reflection.Assembly.InternalLoad(AssemblyName
> >> >> > > assemblyRef,
> >> >> > > Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
> >> >> > > forIntrospection)
> >> >> > > at System.Reflection.Assembly.InternalLoad(String
> >> >> > > assemblyString,
> >> >> > > Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
> >> >> > > forIntrospection)
> >> >> > > at System.Reflection.Assembly.Load(String assemblyString)
> >> >> > >
> >> >> > > the only way to get the assembly working again is to restart the
> >> >> > > sql
> >> >> > > server
> >> >> > > engine or the whole server.
> >> >> > > sometimes even multiple restarts are needed.
> >> >> > >
> >> >> > > we tried several things to get rid of this message but without any
> >> >> > > access:
> >> >> > > - drop and re-create the assembly and all functions in the
> >> >> > > database
> >> >> > > (with
> >> >> > > visual studio deployment, with t-sql statements loading the
> >> >> > > assembly
> >> >> > > from
> >> >> > > a
> >> >> > > file or in binary)
> >> >> > > - change of the assembly permission_set according to the error
> >> >> > > message
> >> >> > > (even
> >> >> > > there is no external access or unsafe code - there is even no
> >> >> > > database
> >> >> > > access
> >> >> > > at all)
> >> >> > > - restrict the maximum server memory at the server options
> >> >> > > - we already tried to setup the whole database on a complete
> >> >> > > different
> >> >> > > independent server with a complete fresh sql server installation
> >> >> > > - update the sql server with service pack 1
> >> >> > > - building the assembly with platform x64 instead of any cpu
> >> >> > >
> >> >> > > configuration of our two test systems
> >> >> > > - WIN2003 SP1 ENT + SQL2005 STD X64 RTM clustered
> >> >> > > - WIN2003 SP1 ENT + SQL2005 DEV X64 SP1 single
> >> >> > >
> >> >> > > any ideas or recommendation regarding this problem? - thanks in
> >> >> > > advance
> >> >> > > mike s.
> >> >> >
> >> >> >
> >> >> >
> >>
> >>
> >>
>
>|||I am interested in getting some more information about the issue - you
should not have to disable and reenable the clr to clear a memory pressure
issue. If possible, I'd like to get a dump of the sql server process when
the error happens.
Can you email me at stevehem at microsoft dot com and I'll give you
instructions on how to do this.
Thanks,
Steven
"FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
news:A3D53B7C-42EA-4C96-A326-1A0946665F65@.microsoft.com...
> hi steven,
> first i tried to reproduce the error message in a new created, blank
> database - but without production load i wasn't able the reach the state
> so i tried to delete unnecessary data and detach the real database, but
> after attaching the database again, the assembly works fine again
> in the meantime i also found a solution to get the assembly working again
> without restarting the server - after disabling and enabling the whole clr
> integration with the following statement the assembly works again
> sp_configure 'clr enabled', 0
> GO
> RECONFIGURE
> GO
> sp_configure 'clr enabled', 1
> GO
> RECONFIGURE
> GO
> according to the documentation this statement issues unloading of all
> appdomains - after re-creating the appdomains the assembly works again
> i also noticed the following behaviour in the sql server log:
> first everything works fine - sometimes after the following messages in
> the
> sql server log the assembly throws the exception each time a function is
> called
> - AppDomain 23 (Core.dbo[runtime].22) is marked for unload due to memory
> pressure.
> - AppDomain 23 (Core.dbo[runtime].22) unloaded.
> - AppDomain 24 (Core.dbo[runtime].23) created.
> hope this information is useful for you
> should i send you more information? i also found some clr related dynamic
> management views
> again thanks for your great support
> mike
> "Steven Hemingray [MSFT]" wrote:
>> I'm not sure what else could be causing this problem to reproduce
>> consistently - it doesn't sound like it could be a resource problem if it
>> reproduces this frequently and the most likely resource issue, Virtual
>> Address Space, is not an issue on x64.
>> Can you recreate the problem by loading the same assembly into a brand
>> new
>> database?
>> If you're able to detach the send me the database when it's in a state
>> that
>> exhibits the problem I can investigate further: stevehem at microsoft dot
>> com.
>> Steven
>>
>> "FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
>> news:9EAE99EF-1DB2-47A8-BF6C-1921ED423A9A@.microsoft.com...
>> > hi steven,
>> > as mentioned in an earlier post the dbo mapping seems to be ok
>> > (according
>> > to
>> > the system catalog views)
>> > here is the result of your statement similar to my query
>> > Name name owner_sid sid
>> > Core dbo 0x01 0x01
>> >
>> > what else can i try?
>> > mike
>> >
>> > "Steven Hemingray [MSFT]" wrote:
>> >
>> >> The way to check for the problem is to see if the owner_sid in
>> >> sys.databases
>> >> does not match the sid for dbo in sys.database_principals.
>> >>
>> >> use YOUR_DATABASE
>> >> go
>> >> select d.name, dp.name, d.owner_sid, dp.sid from sys.databases d,
>> >> sys.database_principals dp where d.owner_sid = dp.sid and dp.name =>> >> 'dbo'
>> >> and d.name = 'YOUR_DATABASE'
>> >>
>> >> If you're still seeing this problem and the above query indicates that
>> >> the
>> >> sids match, then it must be a different problem and I'd have to do
>> >> some
>> >> investigation on what else could cause this to fail repeatedly and on
>> >> different independent servers.
>> >>
>> >> Steven
>> >>
>> >>
>> >> "FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
>> >> news:EB0942FA-39B3-4590-B7F8-73D59A1A0794@.microsoft.com...
>> >> > hi again,
>> >> >
>> >> > after changing the dbo like you describe above it only takes some
>> >> > hours
>> >> > and
>> >> > now the error occurs again
>> >> > any other ideas or suggestions?
>> >> >
>> >> > thanks in advance,
>> >> > mike
>> >> >
>> >> > "FwMsdn" wrote:
>> >> >
>> >> >> hi steven,
>> >> >> first many thanks for your quick response and support!
>> >> >>
>> >> >> you're right the database has been detached and attached on
>> >> >> different
>> >> >> servers during development many times
>> >> >>
>> >> >> can i check this case with the system catalog views?
>> >> >> when i take a look at the sys.databases catalog view the owner_sid
>> >> >> is
>> >> >> 0x01 -
>> >> >> according to the sys.server_principals and sys.database_principals
>> >> >> views
>> >> >> the
>> >> >> sid 0x01 belongs to the login sa and the user dbo
>> >> >>
>> >> >> anyway i will try to change the dbo according to your statement and
>> >> >> hope
>> >> >> that this error won't occur in the future
>> >> >>
>> >> >> thanks again,
>> >> >> mike s.
>> >> >>
>> >> >> "Steven Hemingray [MSFT]" wrote:
>> >> >>
>> >> >> > Hi Mike,
>> >> >> >
>> >> >> > This error can happen when the database has been detached and
>> >> >> > attached
>> >> >> > onto
>> >> >> > a different server and SQL Server is unable to find the correct
>> >> >> > login
>> >> >> > associated with the dbo for that database. If this is the case
>> >> >> > for
>> >> >> > you,
>> >> >> > then you can fix the problem by using sp_changedbowner to
>> >> >> > reassociate
>> >> >> > dbo
>> >> >> > with a valid login like so: exec sp_changedbowner 'sa'. Making
>> >> >> > the
>> >> >> > error
>> >> >> > message more clear is on track to be fixed in a future service
>> >> >> > pack.
>> >> >> > Hope
>> >> >> > this helps.
>> >> >> >
>> >> >> > Steven
>> >> >> >
>> >> >> >
>> >> >> > "FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
>> >> >> > news:537F22F0-200F-4D1C-96AD-E7A211C75644@.microsoft.com...
>> >> >> > > hello together!
>> >> >> > > currently we are developing a server database which is using an
>> >> >> > > assembly
>> >> >> > > with some very simple clr-functions (eg check regular
>> >> >> > > expression
>> >> >> > > or
>> >> >> > > converting local time to universal time).
>> >> >> > > from some indefinite time we receive the following errormessage
>> >> >> > > each
>> >> >> > > time
>> >> >> > > calling such a clr-function:
>> >> >> > >
>> >> >> > > Msg 10314, Level 16, State 11, Line 1
>> >> >> > > An error occurred in the Microsoft .NET Framework while trying
>> >> >> > > to
>> >> >> > > load
>> >> >> > > assembly id 65706. The server may be running out of resources,
>> >> >> > > or
>> >> >> > > the
>> >> >> > > assembly may not be trusted with PERMISSION_SET =>> >> >> > > EXTERNAL_ACCESS
>> >> >> > > or
>> >> >> > > UNSAFE.
>> >> >> > > Run the query again, or check documentation to see how to solve
>> >> >> > > the
>> >> >> > > assembly
>> >> >> > > trust issues. For more information about this error:
>> >> >> > > System.IO.FileNotFoundException: Could not load file or
>> >> >> > > assembly
>> >> >> > > 'myassembly, Version=0.0.0.0, Culture=neutral,
>> >> >> > > PublicKeyToken=null'
>> >> >> > > or one
>> >> >> > > of
>> >> >> > > its dependencies. The system cannot find the file specified.
>> >> >> > > System.IO.FileNotFoundException:
>> >> >> > > at System.Reflection.Assembly.nLoad(AssemblyName fileName,
>> >> >> > > String
>> >> >> > > codeBase, Evidence assemblySecurity, Assembly locationHint,
>> >> >> > > StackCrawlMark&
>> >> >> > > stackMark, Boolean throwOnFileNotFound, Boolean
>> >> >> > > forIntrospection)
>> >> >> > > at System.Reflection.Assembly.InternalLoad(AssemblyName
>> >> >> > > assemblyRef,
>> >> >> > > Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
>> >> >> > > forIntrospection)
>> >> >> > > at System.Reflection.Assembly.InternalLoad(String
>> >> >> > > assemblyString,
>> >> >> > > Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
>> >> >> > > forIntrospection)
>> >> >> > > at System.Reflection.Assembly.Load(String assemblyString)
>> >> >> > >
>> >> >> > > the only way to get the assembly working again is to restart
>> >> >> > > the
>> >> >> > > sql
>> >> >> > > server
>> >> >> > > engine or the whole server.
>> >> >> > > sometimes even multiple restarts are needed.
>> >> >> > >
>> >> >> > > we tried several things to get rid of this message but without
>> >> >> > > any
>> >> >> > > access:
>> >> >> > > - drop and re-create the assembly and all functions in the
>> >> >> > > database
>> >> >> > > (with
>> >> >> > > visual studio deployment, with t-sql statements loading the
>> >> >> > > assembly
>> >> >> > > from
>> >> >> > > a
>> >> >> > > file or in binary)
>> >> >> > > - change of the assembly permission_set according to the error
>> >> >> > > message
>> >> >> > > (even
>> >> >> > > there is no external access or unsafe code - there is even no
>> >> >> > > database
>> >> >> > > access
>> >> >> > > at all)
>> >> >> > > - restrict the maximum server memory at the server options
>> >> >> > > - we already tried to setup the whole database on a complete
>> >> >> > > different
>> >> >> > > independent server with a complete fresh sql server
>> >> >> > > installation
>> >> >> > > - update the sql server with service pack 1
>> >> >> > > - building the assembly with platform x64 instead of any cpu
>> >> >> > >
>> >> >> > > configuration of our two test systems
>> >> >> > > - WIN2003 SP1 ENT + SQL2005 STD X64 RTM clustered
>> >> >> > > - WIN2003 SP1 ENT + SQL2005 DEV X64 SP1 single
>> >> >> > >
>> >> >> > > any ideas or recommendation regarding this problem? - thanks in
>> >> >> > > advance
>> >> >> > > mike s.
>> >> >> >
>> >> >> >
>> >> >> >
>> >>
>> >>
>> >>
>>

.NET exception whenn calling CLR user-defined functions

Hi Mike,
This error can happen when the database has been detached and attached onto
a different server and SQL Server is unable to find the correct login
associated with the dbo for that database. If this is the case for you,
then you can fix the problem by using sp_changedbowner to reassociate dbo
with a valid login like so: exec sp_changedbowner 'sa'. Making the error
message more clear is on track to be fixed in a future service pack. Hope
this helps.
Steven
"FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
news:537F22F0-200F-4D1C-96AD-E7A211C75644@.microsoft.com...
> hello together!
> currently we are developing a server database which is using an assembly
> with some very simple clr-functions (eg check regular expression or
> converting local time to universal time).
> from some indefinite time we receive the following errormessage each time
> calling such a clr-function:
> Msg 10314, Level 16, State 11, Line 1
> An error occurred in the Microsoft .NET Framework while trying to load
> assembly id 65706. The server may be running out of resources, or the
> assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or
> UNSAFE.
> Run the query again, or check documentation to see how to solve the
> assembly
> trust issues. For more information about this error:
> System.IO.FileNotFoundException: Could not load file or assembly
> 'myassembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one
> of
> its dependencies. The system cannot find the file specified.
> System.IO.FileNotFoundException:
> at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
> codeBase, Evidence assemblySecurity, Assembly locationHint,
> StackCrawlMark&
> stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
> at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
> Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
> forIntrospection)
> at System.Reflection.Assembly.InternalLoad(String assemblyString,
> Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
> forIntrospection)
> at System.Reflection.Assembly.Load(String assemblyString)
> the only way to get the assembly working again is to restart the sql
> server
> engine or the whole server.
> sometimes even multiple restarts are needed.
> we tried several things to get rid of this message but without any access:
> - drop and re-create the assembly and all functions in the database (with
> visual studio deployment, with t-sql statements loading the assembly from
> a
> file or in binary)
> - change of the assembly permission_set according to the error message
> (even
> there is no external access or unsafe code - there is even no database
> access
> at all)
> - restrict the maximum server memory at the server options
> - we already tried to setup the whole database on a complete different
> independent server with a complete fresh sql server installation
> - update the sql server with service pack 1
> - building the assembly with platform x64 instead of any cpu
> configuration of our two test systems
> - WIN2003 SP1 ENT + SQL2005 STD X64 RTM clustered
> - WIN2003 SP1 ENT + SQL2005 DEV X64 SP1 single
> any ideas or recommendation regarding this problem? - thanks in advance
> mike s.hello together!
currently we are developing a server database which is using an assembly
with some very simple clr-functions (eg check regular expression or
converting local time to universal time).
from some indefinite time we receive the following errormessage each time
calling such a clr-function:
Msg 10314, Level 16, State 11, Line 1
An error occurred in the Microsoft .NET Framework while trying to load
assembly id 65706. The server may be running out of resources, or the
assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE.
Run the query again, or check documentation to see how to solve the assembly
trust issues. For more information about this error:
System.IO.FileNotFoundException: Could not load file or assembly
'myassembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one o
f
its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&
stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
the only way to get the assembly working again is to restart the sql server
engine or the whole server.
sometimes even multiple restarts are needed.
we tried several things to get rid of this message but without any access:
- drop and re-create the assembly and all functions in the database (with
visual studio deployment, with t-sql statements loading the assembly from a
file or in binary)
- change of the assembly permission_set according to the error message (even
there is no external access or unsafe code - there is even no database acces
s
at all)
- restrict the maximum server memory at the server options
- we already tried to setup the whole database on a complete different
independent server with a complete fresh sql server installation
- update the sql server with service pack 1
- building the assembly with platform x64 instead of any cpu
configuration of our two test systems
- WIN2003 SP1 ENT + SQL2005 STD X64 RTM clustered
- WIN2003 SP1 ENT + SQL2005 DEV X64 SP1 single
any ideas or recommendation regarding this problem? - thanks in advance
mike s.|||Hi Mike,
This error can happen when the database has been detached and attached onto
a different server and SQL Server is unable to find the correct login
associated with the dbo for that database. If this is the case for you,
then you can fix the problem by using sp_changedbowner to reassociate dbo
with a valid login like so: exec sp_changedbowner 'sa'. Making the error
message more clear is on track to be fixed in a future service pack. Hope
this helps.
Steven
"FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
news:537F22F0-200F-4D1C-96AD-E7A211C75644@.microsoft.com...
> hello together!
> currently we are developing a server database which is using an assembly
> with some very simple clr-functions (eg check regular expression or
> converting local time to universal time).
> from some indefinite time we receive the following errormessage each time
> calling such a clr-function:
> Msg 10314, Level 16, State 11, Line 1
> An error occurred in the Microsoft .NET Framework while trying to load
> assembly id 65706. The server may be running out of resources, or the
> assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or
> UNSAFE.
> Run the query again, or check documentation to see how to solve the
> assembly
> trust issues. For more information about this error:
> System.IO.FileNotFoundException: Could not load file or assembly
> 'myassembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one
> of
> its dependencies. The system cannot find the file specified.
> System.IO.FileNotFoundException:
> at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
> codeBase, Evidence assemblySecurity, Assembly locationHint,
> StackCrawlMark&
> stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
> at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
> Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
> forIntrospection)
> at System.Reflection.Assembly.InternalLoad(String assemblyString,
> Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
> forIntrospection)
> at System.Reflection.Assembly.Load(String assemblyString)
> the only way to get the assembly working again is to restart the sql
> server
> engine or the whole server.
> sometimes even multiple restarts are needed.
> we tried several things to get rid of this message but without any access:
> - drop and re-create the assembly and all functions in the database (with
> visual studio deployment, with t-sql statements loading the assembly from
> a
> file or in binary)
> - change of the assembly permission_set according to the error message
> (even
> there is no external access or unsafe code - there is even no database
> access
> at all)
> - restrict the maximum server memory at the server options
> - we already tried to setup the whole database on a complete different
> independent server with a complete fresh sql server installation
> - update the sql server with service pack 1
> - building the assembly with platform x64 instead of any cpu
> configuration of our two test systems
> - WIN2003 SP1 ENT + SQL2005 STD X64 RTM clustered
> - WIN2003 SP1 ENT + SQL2005 DEV X64 SP1 single
> any ideas or recommendation regarding this problem? - thanks in advance
> mike s.|||hi steven,
first many thanks for your quick response and support!
you're right the database has been detached and attached on different
servers during development many times
can i check this case with the system catalog views?
when i take a look at the sys.databases catalog view the owner_sid is 0x01 -
according to the sys.server_principals and sys.database_principals views the
sid 0x01 belongs to the login sa and the user dbo
anyway i will try to change the dbo according to your statement and hope
that this error won't occur in the future
thanks again,
mike s.
"Steven Hemingray [MSFT]" wrote:

> Hi Mike,
> This error can happen when the database has been detached and attached ont
o
> a different server and SQL Server is unable to find the correct login
> associated with the dbo for that database. If this is the case for you,
> then you can fix the problem by using sp_changedbowner to reassociate dbo
> with a valid login like so: exec sp_changedbowner 'sa'. Making the error
> message more clear is on track to be fixed in a future service pack. Hope
> this helps.
> Steven
>
> "FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
> news:537F22F0-200F-4D1C-96AD-E7A211C75644@.microsoft.com...
>
>|||hi again,
after changing the dbo like you describe above it only takes some hours and
now the error occurs again
any other ideas or suggestions?
thanks in advance,
mike
"FwMsdn" wrote:
[vbcol=seagreen]
> hi steven,
> first many thanks for your quick response and support!
> you're right the database has been detached and attached on different
> servers during development many times
> can i check this case with the system catalog views?
> when i take a look at the sys.databases catalog view the owner_sid is 0x01
-
> according to the sys.server_principals and sys.database_principals views t
he
> sid 0x01 belongs to the login sa and the user dbo
> anyway i will try to change the dbo according to your statement and hope
> that this error won't occur in the future
> thanks again,
> mike s.
> "Steven Hemingray [MSFT]" wrote:
>|||hi steven,
first many thanks for your quick response and support!
you're right the database has been detached and attached on different
servers during development many times
can i check this case with the system catalog views?
when i take a look at the sys.databases catalog view the owner_sid is 0x01 -
according to the sys.server_principals and sys.database_principals views the
sid 0x01 belongs to the login sa and the user dbo
anyway i will try to change the dbo according to your statement and hope
that this error won't occur in the future
thanks again,
mike s.
"Steven Hemingray [MSFT]" wrote:

> Hi Mike,
> This error can happen when the database has been detached and attached ont
o
> a different server and SQL Server is unable to find the correct login
> associated with the dbo for that database. If this is the case for you,
> then you can fix the problem by using sp_changedbowner to reassociate dbo
> with a valid login like so: exec sp_changedbowner 'sa'. Making the error
> message more clear is on track to be fixed in a future service pack. Hope
> this helps.
> Steven
>
> "FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
> news:537F22F0-200F-4D1C-96AD-E7A211C75644@.microsoft.com...
>
>|||hi again,
after changing the dbo like you describe above it only takes some hours and
now the error occurs again
any other ideas or suggestions?
thanks in advance,
mike
"FwMsdn" wrote:
[vbcol=seagreen]
> hi steven,
> first many thanks for your quick response and support!
> you're right the database has been detached and attached on different
> servers during development many times
> can i check this case with the system catalog views?
> when i take a look at the sys.databases catalog view the owner_sid is 0x01
-
> according to the sys.server_principals and sys.database_principals views t
he
> sid 0x01 belongs to the login sa and the user dbo
> anyway i will try to change the dbo according to your statement and hope
> that this error won't occur in the future
> thanks again,
> mike s.
> "Steven Hemingray [MSFT]" wrote:
>|||The way to check for the problem is to see if the owner_sid in sys.databases
does not match the sid for dbo in sys.database_principals.
use YOUR_DATABASE
go
select d.name, dp.name, d.owner_sid, dp.sid from sys.databases d,
sys.database_principals dp where d.owner_sid = dp.sid and dp.name = 'dbo'
and d.name = 'YOUR_DATABASE'
If you're still seeing this problem and the above query indicates that the
sids match, then it must be a different problem and I'd have to do some
investigation on what else could cause this to fail repeatedly and on
different independent servers.
Steven
"FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
news:EB0942FA-39B3-4590-B7F8-73D59A1A0794@.microsoft.com...[vbcol=seagreen]
> hi again,
> after changing the dbo like you describe above it only takes some hours
> and
> now the error occurs again
> any other ideas or suggestions?
> thanks in advance,
> mike
> "FwMsdn" wrote:
>|||The way to check for the problem is to see if the owner_sid in sys.databases
does not match the sid for dbo in sys.database_principals.
use YOUR_DATABASE
go
select d.name, dp.name, d.owner_sid, dp.sid from sys.databases d,
sys.database_principals dp where d.owner_sid = dp.sid and dp.name = 'dbo'
and d.name = 'YOUR_DATABASE'
If you're still seeing this problem and the above query indicates that the
sids match, then it must be a different problem and I'd have to do some
investigation on what else could cause this to fail repeatedly and on
different independent servers.
Steven
"FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
news:EB0942FA-39B3-4590-B7F8-73D59A1A0794@.microsoft.com...[vbcol=seagreen]
> hi again,
> after changing the dbo like you describe above it only takes some hours
> and
> now the error occurs again
> any other ideas or suggestions?
> thanks in advance,
> mike
> "FwMsdn" wrote:
>|||hi steven,
as mentioned in an earlier post the dbo mapping seems to be ok (according to
the system catalog views)
here is the result of your statement similar to my query
Name name owner_sid sid
Core dbo 0x01 0x01
what else can i try?
mike
"Steven Hemingray [MSFT]" wrote:

> The way to check for the problem is to see if the owner_sid in sys.databas
es
> does not match the sid for dbo in sys.database_principals.
> use YOUR_DATABASE
> go
> select d.name, dp.name, d.owner_sid, dp.sid from sys.databases d,
> sys.database_principals dp where d.owner_sid = dp.sid and dp.name = 'dbo'
> and d.name = 'YOUR_DATABASE'
> If you're still seeing this problem and the above query indicates that the
> sids match, then it must be a different problem and I'd have to do some
> investigation on what else could cause this to fail repeatedly and on
> different independent servers.
> Steven
>
> "FwMsdn" <FwMsdn@.discussions.microsoft.com> wrote in message
> news:EB0942FA-39B3-4590-B7F8-73D59A1A0794@.microsoft.com...
>
>

.NET Custom UDF - "Internal error: An unexpected exception occured."

Hi!

I have developed some .NET UDF for MSAS2005.
I compiled it, added assembly to database and tested it - it works.
But works only on my test seerver. On life server I've got this message:
"Internal error: An unexpected exception occured."
Assembly is registered as unrestricted.
I've maid simple test function in own assembly file, which just gives back 1.
It also works on test- and does not work on life server.
Customer will kill me :-( ....
P.S. Last post-SP1-fix (form July) is installed.

I (and a few other people) have been working on writing some stored procs for AS which will be available for public download soon, and we've seen this error a lot. The only information I can give you about it is that it seems to be sporadic and happen more often on lower-spec machines. I believe it's already been logged as a bug; until it's fixed, in my opinion you can't really use AS stored procs in a production environment.

Sorry...

Chris

|||

Thanx Chris for reply,
but it is not our case, because our Life-Server has much more Performance

|||

Are there any updates on this issue? I get this same error on our production server even though it never happened in development and testing (2 different servers).

The problem is very erratic and may happen or not happen in a given cube depending on how the query is built.

Any help would be appreciated.

|||

Hi All,

We have come across this error too but can only find evidence of Microsoft fixing this issue in SP1... http://support.microsoft.com/kb/912429/. However this issue is described as happening not in AS stored procs but in standard queries made even from SSMS.

Does anyone have any information or links etc that shows that this particular issue relating to SPs has been acknowledged by Microsoft? It's been requested by our project manager...

As per usual, any feedback will be gratefully received.

Rob.

|||

The error "Internal error: An unexpected exception occured." is generic in a sense, that it is raised when AS detects any internal inconsistency. So the KB912429 is about different cause. However, the following KB seems more relevant: http://support.microsoft.com/kb/918753/

Yura - I suggest you contact PSS and request this hotfix. Alternatively, you can wait for SP2, where this hotfix is rolled into.

HTH,

Mosha (http://www.mosha.com/msolap)

|||

We have already found (and solve) a problem. This error happends then, when R-ROLAP partition and something is not correct with DataTypes.

Mutch more necessary are trace messages for Custom UDFs. You told what this messages are simple DataRows - could be, but how to send them? With which .NET API method?

|||

Mutch more necessary are trace messages for Custom UDFs. You told what this messages are simple DataRows - could be, but how to send them? With which .NET API method ?

You can build standard rowset inside sproc and return it from there. Then, if you invoke it with CALL sproc you can get rowset back to the client tool (such as SSMS).

|||

Mosha Pasumansky wrote:

Mutch more necessary are trace messages for Custom UDFs. You told what this messages are simple DataRows - could be, but how to send them? With which .NET API method ?

You can build standard rowset inside sproc and return it from there. Then, if you invoke it with CALL sproc you can get rowset back to the client tool (such as SSMS).


Ok, now I got it. Is it only way? I mean, is it possible to have both - result of execution and trace messages? Like by .NET StoredProcedures in SQL Server - Pipe.Send(...) method give you possibility to send Rows, RewSets (as result set) and strings (as a-la PRINT messages).
But in SSAS we have only "chanel" - result. It could be string, numeric or RecordSet, but only one way - correct?

|||Yes, in SSAS there is only one result - either MDDataSet or Rowset. The only way to have second channel is to write into Trace which can be monitored with Profiler. There is no equivalent to SQL Server Pipe.Send() method.|||No solution yet!! I installed SQL SP2 (CTP) and I still have the same problem. Anyone please help !! I hope Microsoft is listening.|||No solution to what problem ? The original problem that started this thread is solved in SP1 (and therefore in SP2). And if you are refering to the new feature request of equivalent of SQL's Pipe.Send - than you shouldn't have expected new features out of the service pack. Service pack is to fix existing problems (whether wrong results, major performance issues or crashes), not to introduce new functionality. If you would like to see new functionality in the next version, the best way is to open an issue on 'connect', and let people vote for it.|||

Mosha Pasumansky wrote:

... If you would like to see new functionality in the next version, the best way is to open an issue on 'connect', and let people vote for it.

Done! You can vote for this feature here:

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=261868

|||Hi Mosha,

Sorry for replying late on same. I still have the problem Internal error: An unexpected exception occured." when I use a custom UDF. The UDF expects total of three array (SetToArray) parameter and I believe that' sthe problem. The UDF works fine with one array parameter.

Oh yes, this problem still exists with Sql Server SP2

Original Quote from Mosha - "No solution to what problem ? The original problem that started this thread is solved in SP1 (and therefore in SP2). And if you are refering to the new feature request of equivalent of SQL's Pipe.Send - than you shouldn't have expected new features out of the service pack. Service pack is to fix existing problems (whether wrong results, major performance issues or crashes), not to introduce new functionality. If you would like to see new functionality in the next version, the best way is to open an issue on 'connect', and let people vote for it."

.NET Custom UDF - "Internal error: An unexpected exception occured."

Hi!

I have developed some .NET UDF for MSAS2005.
I compiled it, added assembly to database and tested it - it works.
But works only on my test seerver. On life server I've got this message:
"Internal error: An unexpected exception occured."
Assembly is registered as unrestricted.
I've maid simple test function in own assembly file, which just gives back 1.
It also works on test- and does not work on life server.
Customer will kill me :-( ....
P.S. Last post-SP1-fix (form July) is installed.

I (and a few other people) have been working on writing some stored procs for AS which will be available for public download soon, and we've seen this error a lot. The only information I can give you about it is that it seems to be sporadic and happen more often on lower-spec machines. I believe it's already been logged as a bug; until it's fixed, in my opinion you can't really use AS stored procs in a production environment.

Sorry...

Chris

|||

Thanx Chris for reply,
but it is not our case, because our Life-Server has much more Performance

|||

Are there any updates on this issue? I get this same error on our production server even though it never happened in development and testing (2 different servers).

The problem is very erratic and may happen or not happen in a given cube depending on how the query is built.

Any help would be appreciated.

|||

Hi All,

We have come across this error too but can only find evidence of Microsoft fixing this issue in SP1... http://support.microsoft.com/kb/912429/. However this issue is described as happening not in AS stored procs but in standard queries made even from SSMS.

Does anyone have any information or links etc that shows that this particular issue relating to SPs has been acknowledged by Microsoft? It's been requested by our project manager...

As per usual, any feedback will be gratefully received.

Rob.

|||

The error "Internal error: An unexpected exception occured." is generic in a sense, that it is raised when AS detects any internal inconsistency. So the KB912429 is about different cause. However, the following KB seems more relevant: http://support.microsoft.com/kb/918753/

Yura - I suggest you contact PSS and request this hotfix. Alternatively, you can wait for SP2, where this hotfix is rolled into.

HTH,

Mosha (http://www.mosha.com/msolap)

|||

We have already found (and solve) a problem. This error happends then, when R-ROLAP partition and something is not correct with DataTypes.

Mutch more necessary are trace messages for Custom UDFs. You told what this messages are simple DataRows - could be, but how to send them? With which .NET API method?

|||

Mutch more necessary are trace messages for Custom UDFs. You told what this messages are simple DataRows - could be, but how to send them? With which .NET API method ?

You can build standard rowset inside sproc and return it from there. Then, if you invoke it with CALL sproc you can get rowset back to the client tool (such as SSMS).

|||

Mosha Pasumansky wrote:

Mutch more necessary are trace messages for Custom UDFs. You told what this messages are simple DataRows - could be, but how to send them? With which .NET API method ?

You can build standard rowset inside sproc and return it from there. Then, if you invoke it with CALL sproc you can get rowset back to the client tool (such as SSMS).


Ok, now I got it. Is it only way? I mean, is it possible to have both - result of execution and trace messages? Like by .NET StoredProcedures in SQL Server - Pipe.Send(...) method give you possibility to send Rows, RewSets (as result set) and strings (as a-la PRINT messages).
But in SSAS we have only "chanel" - result. It could be string, numeric or RecordSet, but only one way - correct?

|||Yes, in SSAS there is only one result - either MDDataSet or Rowset. The only way to have second channel is to write into Trace which can be monitored with Profiler. There is no equivalent to SQL Server Pipe.Send() method.|||No solution yet!! I installed SQL SP2 (CTP) and I still have the same problem. Anyone please help !! I hope Microsoft is listening.|||No solution to what problem ? The original problem that started this thread is solved in SP1 (and therefore in SP2). And if you are refering to the new feature request of equivalent of SQL's Pipe.Send - than you shouldn't have expected new features out of the service pack. Service pack is to fix existing problems (whether wrong results, major performance issues or crashes), not to introduce new functionality. If you would like to see new functionality in the next version, the best way is to open an issue on 'connect', and let people vote for it.|||

Mosha Pasumansky wrote:

... If you would like to see new functionality in the next version, the best way is to open an issue on 'connect', and let people vote for it.

Done! You can vote for this feature here:

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=261868

|||Hi Mosha,

Sorry for replying late on same. I still have the problem Internal error: An unexpected exception occured." when I use a custom UDF. The UDF expects total of three array (SetToArray) parameter and I believe that' sthe problem. The UDF works fine with one array parameter.

Oh yes, this problem still exists with Sql Server SP2

Original Quote from Mosha - "No solution to what problem ? The original problem that started this thread is solved in SP1 (and therefore in SP2). And if you are refering to the new feature request of equivalent of SQL's Pipe.Send - than you shouldn't have expected new features out of the service pack. Service pack is to fix existing problems (whether wrong results, major performance issues or crashes), not to introduce new functionality. If you would like to see new functionality in the next version, the best way is to open an issue on 'connect', and let people vote for it."