Thema: Function

Einzelnen Beitrag anzeigen

arcon

Registriert seit: 8. Jun 2010
71 Beiträge
 
#9

AW: Function

  Alt 27. Jul 2010, 13:44
SQL-Code:
-- ================================================
-- Template generated from Template Explorer using:
-- Create Scalar Function (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comments will not be included in
-- the definition of the function.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:      <Author,,Name>
-- Create date: <Create Date, ,>
-- Description:   <Description, ,>
-- =============================================
CREATE FUNCTION [dbo].[fn_Parameter_changes_Monitoring_Parameter_Unit]
(
   -- Add the parameters for the function here
   @PARAM AS INT
)
RETURNS NVARCHAR(5)
AS
BEGIN
   IF NOT (@Param = '')
         BEGIN
            DECLARE @VALUE AS NVARCHAR(5)
            SET @VALUE = (SELECT [Value]
            FROM Parameter_changes_Monitoring_Parameter_Settings
            WHERE ([Param] = 'Parameter ' + CAST(@Param AS NVARCHAR(5)) + ' Unit'))
         END

   
   RETURN @VALUE

END
GO

Geändert von mkinzler (27. Jul 2010 um 13:49 Uhr) Grund: CODE-Tag durch SQL-Tag ersetzt
  Mit Zitat antworten Zitat