Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Null on Null Input | False |
| Schema Bound | False |
| Assembly |
Parameters
| Name | Data Type | Length | Description |
|---|---|---|---|
| (Result) | decimal | 9 | |
| @valueStr | varchar | 255 |
SQL Script
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE FUNCTION dbo.StrToDec2 (
@valueStr varchar(255) )
RETURNS decimal(18,2)
WITH EXECUTE AS CALLER
AS
BEGIN
declare @iv decimal(18,2)
if (@valueStr is null) or (len(ltrim(rtrim(@valueStr)))=0)
begin
set @iv= null
end
else
begin
set @iv= (cast(@valueStr as decimal(18,2)))
end
return @iv
END;
GO
GO
CREATE FUNCTION dbo.StrToDec2 (
@valueStr varchar(255) )
RETURNS decimal(18,2)
WITH EXECUTE AS CALLER
AS
BEGIN
declare @iv decimal(18,2)
if (@valueStr is null) or (len(ltrim(rtrim(@valueStr)))=0)
begin
set @iv= null
end
else
begin
set @iv= (cast(@valueStr as decimal(18,2)))
end
return @iv
END;
GO
Depends On
No items found