CLR Trigger for Automatic Registration of UDXs on CREATE ASSEMBLY

Using a CLR trigger we can register all user defined functions, procedures, types, aggregates etc., contained in an assembly when it is created in the database on “CREATE ASSEMBLY … “. This saves us the time of registering all these ourselfves. We skip the “CREATE PROCEDURE …”, “CREATE AGGREGATE …” steps usually necessary after registering…

6

CLR Trigger for Automatic Registration of UDXs on CREATE ASSEMBLY

This code is provided “AS IS” with no warranties, and confers no rights. I’ve made some small modifications to comply with standard naming conventions on 11/30/2005. Save the following into AutoRegisterTrigger.cs ——————————————————–using System; using System; using Microsoft.SqlServer.Server; using System.Data; using System.Data.SqlTypes; using System.Data.SqlClient; using System.Xml; using System.Reflection; using System.Text.RegularExpressions; namespace Microsoft.SqlServer.Sample { public class AutoRegister {…

1

Best Week Ever

SQL Server provides the ability to find the week of the year in which a given date lies.  For example: declare @d datetimeset @d = ’13 november 2005′select datepart(ww, @d) The result of this is 47. Now, the problem with this is that the correct result according to ISO 8601 is 45, not 47.  Why? …

11