I set my database to trustworthy and deployed this clr stored proc as unsafe ok but when i run this

D

DR

I set my database to trustworthy and deployed this clr stored proc as unsafe
ok but when i run this it returns 1 each time. as if ival keeps getting set
back to 0 each time i call this clr stored proc. How to fix so that ival
keeps its current value each time i execute this from sql server?


public partial class UserDefinedFunctions
{
static long ival = 0;
[Microsoft.SqlServer.Server.SqlFunction]
public static long GetTimestampF()
{
return ++ival;
}
};
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top