|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Monday, July 30, 2012 10:42 AM
Points: 3,434,
Visits: 519
|
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 2:46 AM
Points: 2,750,
Visits: 1,409
|
|
@set PATH=%FrameworkSDKDir%\bin;%FrameworkDir%\%FrameworkVersion%;%PATH%;
Shouldn't that read
@set PATH=%FrameworkDir%\bin;%FrameworkDir%\%FrameworkVersion%;%PATH%;
And in the source code where is the LogIt function defined?
Other than that it is nice to see a practical example of the CLR functionality.
LinkedIn Profile
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Wednesday, May 30, 2007 7:56 AM
Points: 208,
Visits: 1
|
|
The path works for me by the looks of it, i just installed the framework with the defaults. The logit function is in the code isn't it: Public Shared Sub LogIt(ByVal logMessage As String, ByVal w As TextWriter) w.Write(ControlChars.CrLf & "Log Entry : ") w.WriteLine("{0} {1}", DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString()) w.WriteLine(" :") w.WriteLine(" :{0}", logMessage) w.WriteLine("-------------------------------") ' Update the underlying file. w.Flush() End Sub Excellent article, thanks, i found very usefull.
Growing old is mandatory, growing up is optional
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 1:59 AM
Points: 1,126,
Visits: 924
|
|
| Good stuff - I've been wondering how that was going to work.
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Monday, July 30, 2012 10:42 AM
Points: 3,434,
Visits: 519
|
|
David, It was a good point about the Path. That is why I say in the article that one should verify path in his/her installation. You pointed at FrameworkSDKDir versus FrameworkDir. I remember installing SDK on one computer and not installing on another computer (at least, explicitly) . This path works for 2 workstations and one server. All 3 running a lot of software.I would suggest finding the directory with VBC (Visual Basic Compiler) and relevant dlls in the compiler line and modify path accordingly. All, Thanks for reading the article and for your feedback! I will log in again to see if you have more questions. Yelena
Regards, Yelena Varshal
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Thursday, April 12, 2012 11:03 AM
Points: 455,
Visits: 45
|
|
Now, this is a good article and example of what can be done with the SQLCLR integration.
I can't help but think, it's gotta make DBAs very nervous from a security and stability perspective.
{Francisco}
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 6:38 AM
Points: 1,137,
Visits: 668
|
|
I'm not certain that your stored procedure is thread safe. Remember, multiple processes may call this at the same time -- the file will be locked if someone else is writing to it, and you will throw an exception. Unfortunately, I'm not certain how to check first...
On that same note, you should probably use w.Dispose() instead of w.Close(), and wrap the whole thing in a try/finally block in case something bad happens (e.g. an exception). If you do hit an exception currently, the Close() will not get hit -- and the file will remain locked until the GC happens to come along and do its thing.
-- Adam Machanic SQL Server MVP SQLblog.com: THE SQL Server Blog Spot on the Web
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Monday, July 30, 2012 10:42 AM
Points: 3,434,
Visits: 519
|
|
Adam and Francisco, You are certainly right. When I write production code I always think of security, thread safety, stability, handling exceptions and disposing of the objects that are no more in use. I think I may post something on security later, I have some unusual examples. This article is a "Proof-Of-Concept" that yes, we can write stored procedures in programming languages and yes, it is working. So I just used the most basic code. In addition, I wanted to use VB code that is as simple as possible and easy to read for those DBAs who have sysadmin background without programming experience. Yelena
Regards, Yelena Varshal
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 12:22 PM
Points: 192,
Visits: 111
|
|
Yelena: It is a good article, simple and make sense. Like you wrote, some database guy might not be familiar with the .Net, like me. So, simple example with good concept are good for me, thanks for the article. On the other hand, it looks like the quality of DB design today is less important as ever...... p.s. What will be your recommandation about .Net VB and .Net C# self learning books? thanks -D
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Thursday, December 21, 2006 1:32 PM
Points: 41,
Visits: 1
|
|
thanks, this is a good example for those who have limited knowlege of .net.
|
|
|
|