I know that I can define default values for CLR procedures when creating a procedure in the database, for example:
CREATE PROCEDURE [dbo].[ShredXml] ( @InputXml [xml], @AttributeElementHandling [tinyint] = 0, @ConversionHandling [tinyint] = 0, @RootElementName [nvarchar](255) = null ) AS EXTERNAL NAME [ClrXmlShredder].[ClrXmlShredder].[ShredXml]
I can't figure out if there is a way to convince Visual Studio to do this automatically when using the "Deploy Project" option ...
Is there an attribute that can be set for an argument to tell visual studio that you want the default value for this argument to be when it creates proc in the database?
Update: I tried setting the “SqlFacet” value to a null value, which seemed to have no effect (which makes sense, I think the afaik parameters stored in proc always have the value NULL?)
[Microsoft.SqlServer.Server.SqlProcedure] public static void ShredXml(SqlXml InputXml, [SqlFacet(IsNullable = true)]SqlByte AttributeElementHandling, [SqlFacet(IsNullable = true)]SqlByte ConversionHandling, [SqlFacet(MaxSize = 255, IsNullable = true)]string RootElementName ) { }
sql-server visual-studio-2008 deployment sqlclr ssdt
Tao
source share