Showing posts with label load. Show all posts
Showing posts with label load. Show all posts

Tuesday, March 27, 2012

error 9004, severity 21, state 10

saw one of my database went suspect, I tried to load a restore from the backup, but this was going on for ever. I cancelled out, deleted the suspect database. Created a new database and tried to restore from the old backup, but this was going on for ever. It will not restore. I cannot stop and start mssql service on this server as it is production. what else can I do.Q1 On trying to restore from the old backup, this goes on forever. I cannot stop and start mssql service on this server as it is production. What else can I do?

A1 If the issue amounts to the Db remaining in 'Loading' status "forever"; it may simply be that the DB has not been recovered following the restore.

To test this possibility, one would execute a statement similar to the following:

Restore DataBase [DBName] With Recovery

Question I
Can the DB be restored to a development server successfully using the "old backup"?sql

Monday, March 19, 2012

Error 6522 Trying to Run Assembly from database

Hi,
I am attempting to load an assembly that has been stored in a table as a byte array. I have created a c# class called AssemblyLoader that takes in 2 parameters, the assembly name and the parameters for the assembly (just a query string).
From this it returns the assembly byte array using a simple sql statement within the class using the assembly name to select the assembly bytes to return from the database.

The returned byte array of the assembly is loaded using:
Assembly assembly = Assembly.Load(assemblyBytes);


This seems to be the line that SQL Server 2005 is erroring on. Do I need to add some extra assemblies to the database and if so which ones.

Error:
Msg 6522, Level 16, State 1, Procedure ClientInterface, Line 0
A .NET Framework error occurred during execution of user defined routine or aggregate 'ClientInterface':
System.IO.FileLoadException: LoadFrom(), LoadFile(), Load(byte[]) and LoadModule() have been disabled by the host.
System.IO.FileLoadException:
at System.Reflection.Assembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection)
at System.Reflection.Assembly.Load(Byte[] rawAssembly)
at Reflector.runQuery(String query, String parameter)
Thanks for your help.

SQL Server does not allow you to load an assembly from file, nor byte array. You can only call Assembly.Load(), in which case the assembly has to be catalogued in the database.

Niels|||Cheers Niels
I am using Assembly.Load with the Full name of the assembly and it works fine.
Thanks|||So does this mean that you can create a Class Library project, compile it and then simply place the assembly inside SQL 2005 to get access to external objects?
Just to confirm, you are not limited to placing the output of SQL Server Project inside SQL Server 2005?

Thank you,

Lubomir|||Thats pretty much all I have done. I have created 3 seperate Class Library Projects that each extend a common interface so that they all have the method

public static string execute(string data)

and are compiled and added to the database. They are loaded depending on the query I pass in and they go off and get data from different interfaces ie, LDAP, HTTP SOAP etc... and return me a simple string.

N
|||Lubomir,
A SQL CLR Project is just a project type in VS, which makes it easier for the developer to create and deploy assemblies to SQL Server. Under the cover the SQL CLR Project is just calling CREATE ASSEMBLY ... etc, in order to deploy.

Niels

Error 6522 Trying to Run Assembly from database

Hi,
I am attempting to load an assembly that has been stored in a table as a byte array. I have created a c# class called AssemblyLoader that takes in 2 parameters, the assembly name and the parameters for the assembly (just a query string).
From this it returns the assembly byte array using a simple sql statement within the class using the assembly name to select the assembly bytes to return from the database.

The returned byte array of the assembly is loaded using:
Assembly assembly = Assembly.Load(assemblyBytes);


This seems to be the line that SQL Server 2005 is erroring on. Do I need to add some extra assemblies to the database and if so which ones.

Error:
Msg 6522, Level 16, State 1, Procedure ClientInterface, Line 0
A .NET Framework error occurred during execution of user defined routine or aggregate 'ClientInterface':
System.IO.FileLoadException: LoadFrom(), LoadFile(), Load(byte[]) and LoadModule() have been disabled by the host.
System.IO.FileLoadException:
at System.Reflection.Assembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection)
at System.Reflection.Assembly.Load(Byte[] rawAssembly)
at Reflector.runQuery(String query, String parameter)
Thanks for your help.

SQL Server does not allow you to load an assembly from file, nor byte array. You can only call Assembly.Load(), in which case the assembly has to be catalogued in the database.

Niels
|||Cheers Niels
I am using Assembly.Load with the Full name of the assembly and it works fine.
Thanks
|||So does this mean that you can create a Class Library project, compile it and then simply place the assembly inside SQL 2005 to get access to external objects?
Just to confirm, you are not limited to placing the output of SQL Server Project inside SQL Server 2005?

Thank you,

Lubomir|||Thats pretty much all I have done. I have created 3 seperate Class Library Projects that each extend a common interface so that they all have the method

public static string execute(string data)

and are compiled and added to the database. They are loaded depending on the query I pass in and they go off and get data from different interfaces ie, LDAP, HTTP SOAP etc... and return me a simple string.

N
|||Lubomir,
A SQL CLR Project is just a project type in VS, which makes it easier for the developer to create and deploy assemblies to SQL Server. Under the cover the SQL CLR Project is just calling CREATE ASSEMBLY ... etc, in order to deploy.

Niels

Wednesday, March 7, 2012

error 3926 , server failed to resume transaction

In a high load asp.net environment, I am getting an error.

The transation active in this session has been committed or aborted by another session.

Here is the code , I am getting error.

1object returnObject =null;2 SqlTransaction sqlTrans =null;3try4 {5//Getting new SqlConnection6 comm.Connection = GetConnection();7//Opening connection8 OpenConn(comm.Connection);9//beginning transaction10 sqlTrans = comm.Connection.BeginTransaction( IsolationLevel.ReadCommitted );11//setting transaction to SqlCommand object12 comm.Transaction = sqlTrans;13//executing operation14 returnObject = comm.ExecuteScalar();15//trying to commit.16 sqlTrans.Commit();171819 }20catch (SqlException sex)21 {22if (sqlTrans !=null)23 {24 sqlTrans.Rollback();25 }26 }27finally28 {29 comm.Connection.Close();30 }
Could you please explain , am I doing smthg wrong ?

Check out this link: http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2041937&SiteID=17

Good luck.

|||

Hi CS4Ever ,

Thanks for the reply, but as far as I understood , Thona just submitted the situation , not a solution and the 3rd reply belongs to me :)

What could I possibly do ? Submit a bug to Microsoft ?

Thanks in advance.

|||

Still no answers ?

Sunday, February 19, 2012

Error 22272: Cannot load the DLL xpstar.dll...

Hi,

I'm running SQL Server 2000 on a Windows 2003 server. It's serving
several small web site databases.

About a month ago my automatic backups stopped working, and whenever I
try to edit or set up a new maintenance plan or export or import data
through Enterprise Manager, I get the following error:

Error 22272: Cannot load the DLL xpstar.dll, or one of the DLLs it
references. Reason: 127(The specified procedure could not be found.).

I've also tried doing these tasks with some third-party apps (EMS,
Teratrax), and I get the same errors.

I've Googled this but the two fixes I've read about (reinstalling MDAC
and reinstalling SP4) didn't work for me.

I'm not sure what caused it -- probably a Windows update -- because I
didn't notice it until several weeks later.

Any idea what I can do to fix this without completely reinstalling SQL
Server? Its other functionality is unaffected; maybe it's a Windows
problem?

At a loss. Thanks.Pupkin (spamagnet@.dorrk.com) writes:

Quote:

Originally Posted by

About a month ago my automatic backups stopped working, and whenever I
try to edit or set up a new maintenance plan or export or import data
through Enterprise Manager, I get the following error:
>
Error 22272: Cannot load the DLL xpstar.dll, or one of the DLLs it
references. Reason: 127(The specified procedure could not be found.).
>
I've also tried doing these tasks with some third-party apps (EMS,
Teratrax), and I get the same errors.


I would look for MSVCR71.DLL in SYSTEM32. I would suspect that this is
what is missing.)

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||In article <Xns981A1C3B728EYazorman@.127.0.0.1>, esquel@.sommarskog.se
says...

Quote:

Originally Posted by

Pupkin (spamagnet@.dorrk.com) writes:

Quote:

Originally Posted by

About a month ago my automatic backups stopped working, and whenever I
try to edit or set up a new maintenance plan or export or import data
through Enterprise Manager, I get the following error:

Error 22272: Cannot load the DLL xpstar.dll, or one of the DLLs it
references. Reason: 127(The specified procedure could not be found.).

I've also tried doing these tasks with some third-party apps (EMS,
Teratrax), and I get the same errors.


>
I would look for MSVCR71.DLL in SYSTEM32. I would suspect that this is
what is missing.)
>


Nope. That one's in 9 different places in the system, including
system32.|||Pupkin (spamagnet@.dorrk.com) writes:

Quote:

Originally Posted by

In article <Xns981A1C3B728EYazorman@.127.0.0.1>, esquel@.sommarskog.se
says...

Quote:

Originally Posted by

>Pupkin (spamagnet@.dorrk.com) writes:

Quote:

Originally Posted by

About a month ago my automatic backups stopped working, and whenever I
try to edit or set up a new maintenance plan or export or import data
through Enterprise Manager, I get the following error:
>
Error 22272: Cannot load the DLL xpstar.dll, or one of the DLLs it
references. Reason: 127(The specified procedure could not be found.).
>
I've also tried doing these tasks with some third-party apps (EMS,
Teratrax), and I get the same errors.


>>
>I would look for MSVCR71.DLL in SYSTEM32. I would suspect that this is
>what is missing.)
>>


>
Nope. That one's in 9 different places in the system, including
system32.


And XPSTAR.DLL itself is in the BINN directory for the instance?

I chanced on MSVCR71 after having looked at the dependencies for
XPSTAR.DLL and that was the only that looked suspicious.

Then again, the message says that the procedure could not be found.
I believe that if an entire DLL was missing, the error would be another.
But whether this missing procedure is xpstar.dll itself, or in a
referenced DLL that has been replaced I have no idea.

Reinstall the SQL Server tools? Don't forget to reapply service packs.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Error 22272: Cannot load the DLL xpstar.dll,...

Hi,

I'm running SQL Server 2000 on a Windows 2003 server.

About some days ago, my automatic backups stopped working, and whenever I try to edit or set up a new maintenance plan or export or import data through Enterprise Manager, I get the following error:

Error 22272: Cannot load the dll xptar.dll, or one of the dll's it references. Reason: 126 (the specified module could not be found.)

Any Idea why ?

Look for MSVCR71.DLL in SYSTEM32 directory whether it is present or not.

If no luck then you have to reinstall client tools.

|||Hi,

MSVCR71.DLL in SYSTEM32 directory is present ,. but still i am getting the same error what should i do ?

Please help
|||

That's only one of the files you'd want to look for. You would want to check what files xpstar.dll has dependencies on and search based on all the files. You can use a dependency tool to check the dependencies - try this one:

http://www.dependencywalker.com/

and point it to xpstar.dll

You may also want to try reapplying the last service pack you have installed - that will sometimes find and install the missing files, depending on what is missing.

-Sue

Error 22272: Cannot load the DLL xpstar.dll,...

Hi,

I'm running SQL Server 2000 on a Windows 2003 server.

About some days ago, my automatic backups stopped working, and whenever I try to edit or set up a new maintenance plan or export or import data through Enterprise Manager, I get the following error:

Error 22272: Cannot load the dll xptar.dll, or one of the dll's it references. Reason: 126 (the specified module could not be found.)

Any Idea why ?

Look for MSVCR71.DLL in SYSTEM32 directory whether it is present or not.

If no luck then you have to reinstall client tools.

|||Hi,

MSVCR71.DLL in SYSTEM32 directory is present ,. but still i am getting the same error what should i do ?

Please help
|||

That's only one of the files you'd want to look for. You would want to check what files xpstar.dll has dependencies on and search based on all the files. You can use a dependency tool to check the dependencies - try this one:

http://www.dependencywalker.com/

and point it to xpstar.dll

You may also want to try reapplying the last service pack you have installed - that will sometimes find and install the missing files, depending on what is missing.

-Sue