﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / T-SQL (SS2K5)  / True WHOLE NUMBER function. / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 23 May 2013 16:24:24 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: True WHOLE NUMBER function.</title><link>http://www.sqlservercentral.com/Forums/Topic541385-338-1.aspx</link><description>THanks.</description><pubDate>Sat, 26 Jul 2008 09:59:30 GMT</pubDate><dc:creator>pcq0125</dc:creator></item><item><title>RE: True WHOLE NUMBER function.</title><link>http://www.sqlservercentral.com/Forums/Topic541385-338-1.aspx</link><description>You already have a true whole number function and it works well.  The only problem is with how you tested it... you've passed a numeric value to the function and +6 is not a naturally occuring numeric.  The "+" is nothing more than a formatting symbol in this case.Any conversion from +6 without single quotes to a varchar whether in your function or not, will result in just a '6'.  Further, no natural numeric datatype will actually store the "+" sign so, if it's a number, you don't have to worry about testing for a plus sign.</description><pubDate>Sat, 26 Jul 2008 08:52:04 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>True WHOLE NUMBER function.</title><link>http://www.sqlservercentral.com/Forums/Topic541385-338-1.aspx</link><description>I need to create a true WHOLE NUMBER function that does not contains -+?/ and all operators or funny characters.After I created the function below it seems like it will still accept '+'  or anything returns 0 or &amp;gt;. Please advise. Thanks.select dbo.fn_ISTRUEWholeNumber(+6)and the result returns 1 Below is my function--------------------------------------------- =============================================-- Drop Function-- =============================================IF EXISTS ( select * from information_schema.routines    where SPECIFIC_SCHEMA = 'dbo' and SPECIFIC_NAME = N'fn_ISINTEGER'  and ROUTINE_TYPE = 'FUNCTION ' ) 	DROP FUNCTION dbo.fn_ISTRUEWholeNumbergo-- =============================================-- Create Function-- =============================================CREATE FUNCTION dbo.fn_ISTRUEWholeNumber(   @strToBeEval varchar(1000) -- enlarge this if needed)RETURNS bitASBEGIN	DECLARE @bitReturn bit	IF @strToBeEval LIKE '%[^0-9]%' 		SET @bitReturn = 0	ELSE		SET @bitReturn = 1	RETURN @bitReturnENDGO</description><pubDate>Sat, 26 Jul 2008 08:30:51 GMT</pubDate><dc:creator>pcq0125</dc:creator></item></channel></rss>