Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SingleTon

Author  Topic 

cruxmagi
Starting Member

38 Posts

Posted - 2008-05-09 : 08:35:08
I would like to know if a singleton Stored Procedures can be created in SQLCLR

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-05-10 : 07:28:24
I don't think so...what's your objective? You want to insure that a process can not run concurrently? There may be other ways to achieve that. Could you give some detail about what you're trying to accomplish?

Be One with the Optimizer
TG
Go to Top of Page

cruxmagi
Starting Member

38 Posts

Posted - 2008-05-13 : 02:55:36
is there any possibilities to implement N-Tier atchitecture in CLR stored procedures
Go to Top of Page

cruxmagi
Starting Member

38 Posts

Posted - 2008-05-13 : 02:55:47
is there any possibilities to implement N-Tier atchitecture in CLR stored procedures
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-05-13 : 09:13:00
Yes

Be One with the Optimizer
TG
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2008-05-13 : 11:18:13
Good luck on your test, quiz or job interview.



- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

Johnde81
Starting Member

1 Post

Posted - 2011-10-14 : 08:39:45
I did the following today in CLR

C#

private static string TheValue = "h";

[Microsoft.SqlServer.Server.SqlProcedure]
public static void SetValue(SqlString value)
{
TheValue += value.ToString();
}

[Microsoft.SqlServer.Server.SqlFunction]
public static SqlString GetValue()
{
return (SqlString)TheValue;
}

SQL:

exec dbo.SetValue 'ello'

select dbo.GetValue()

and it returned: hello

after 2 hours I ran dbo.GetValue() again and it returned the static value.

After restarting SQL it only returned the initial value of 'h'

So I am sure you can have a singleton in CLR. Will do more research on the object life cycle and post
Go to Top of Page
   

- Advertisement -