Home All Groups Group Topic Archive Search About

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

Author
29 Oct 2007 11:18 PM
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;
    }
};

AddThis Social Bookmark Button