SQL CLR TVF ORDER BY hint is ignored
bvukov
Posts: 3
When scripting SQL CLR Table Valued Function with SSMS, ORDER BY hint is not shown.
-- Original Script ...
CREATE FUNCTION [dbo].[FunctionName]( @SomeArgument bit )
RETURNS TABLE (
Value1 int,
Ordinal int)
WITH EXECUTE AS CALLER
ORDER ( Ordinal ASC ) AS -- <-- this is the hint we're talking about !
EXTERNAL NAME [AssemblyName].[Class].[FunctionName]
-- ... becomes scripted as ...
CREATE FUNCTION [dbo].[FunctionName] (@SomeArgument bit )
RETURNS TABLE (
[Value1] [int],
[Ordinal] [int] NULL)
WITH EXECUTE AS CALLER
EXTERNAL NAME [AssemblyName].[Class].[FunctionName]
GO
-- Original Script ...
CREATE FUNCTION [dbo].[FunctionName]( @SomeArgument bit )
RETURNS TABLE (
Value1 int,
Ordinal int)
WITH EXECUTE AS CALLER
ORDER ( Ordinal ASC ) AS -- <-- this is the hint we're talking about !
EXTERNAL NAME [AssemblyName].[Class].[FunctionName]
-- ... becomes scripted as ...
CREATE FUNCTION [dbo].[FunctionName] (@SomeArgument bit )
RETURNS TABLE (
[Value1] [int],
[Ordinal] [int] NULL)
WITH EXECUTE AS CALLER
EXTERNAL NAME [AssemblyName].[Class].[FunctionName]
GO
Comments
Sorry to hear that you're hitting an issue with Compare. It appears you've found a feature of CLR functions that is not currently understood by our comparison engine. I've logged a bug for us to look at getting this properly supported and resolved (SC-8034). I'll make a note to let you know on this thread when this issue is resolved.
Regards,
David
Redgate Software