Link to home
Start Free TrialLog in
Avatar of aneilg
aneilgFlag for United Kingdom of Great Britain and Northern Ireland

asked on

sql function

i am trying to create the following sunction but i get an error, near the begin.


USE ReportServer

/****** Object:  StoredProcedure [ExecutionLogReport]    Script Date: 02/07/2012 11:14:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO

CREATE FUNCTION [dbo].[rptListReportingDataSources]

(@DataSourceID uniqueidentifier)


BEGIN

SET NOCOUNT ON

SELECT    
      cast(null AS uniqueidentifier) AS DataSourceID
    , 'All' AS DataSourceName

UNION ALL

SELECT    
      ItemID
    , [Name]

FROM    
      ReportServer.dbo.Catalog dscat WITH (NOLOCK)
WHERE    
      [Type] = 5
return @DataSourceID

END

GO
ASKER CERTIFIED SOLUTION
Avatar of Rajkumar Gs
Rajkumar Gs
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aneilg

ASKER

i've tried that,
RETURNS uniqueidentifier

but get an error on the select.
Avatar of aneilg

ASKER

partly answered.
Sorry! I was out for sometime.

In future questions, for better and quicker response please post the ways you tried to solve this issue and also post the error message you received (this is important).

Raj