In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Summary:
Below, we will make a function for isnumber to verify the integer type for numerical judgment in the sql script, as follows:
Example: implementation principle: to judge whether it contains special characters Whether all 0-9 natural numbers make up CREATE FUNCTION dbo.check_number (/ * verify whether a string type is an integer numeric type * / @ checkTmp VARCHAR) RETURNS BITBEGINDECLARE @ tmp BITIF LEFT (@ checkTmp, 1) ='- 'SET @ checkTmp = SUBSTRING (@ checkTmp, 2, LEN (@ checkTmp)) IF (PATINDEX ('% [^ 0-9 -]%', @ checkTmp) = 0AND CHARINDEX ('-') @ checkTmp) 0AND @ checkTmp NOT LIKE'% -%') SET @ tmp = 1ELSESET @ tmp = 0RETURN @ tmpENDGO/* data validation * / SELECT '878' [test value], dbo.check_number (' 999') [test return value] SELECT 'testData' [test value], dbo.check_number (' abc') [test return value]; SELECT'8-8' [test value], dbo.check_number ('999') [test return value]; SELECT '8.9' [test value], dbo.check_number (' $9.9') [test return value] SELECT 'maomao365.com' [test value], dbo.check_number (' maomao365.com') [test return value]; godrop function check_number
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.