In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.