Ms SQL to verify whether a string contains uppercase and lowercase letters, including uppercase and lowercase letters
Ms SQL to verify whether a string contains uppercase/lowercase letters
Last night, a small function was implemented to check whether the string contains
SQL statements are case-insensitive by default, so the statement:
SQL codeSELECT * FROM RecEngineBizInfo WHERE RecEngineBizName = 'qq'AndSQL codeSELECT * FROM RecEngineBizInfo WHERE RecEngineBizName = 'qq'
The results are the same.
The script to check whether A field contains uppercase letters A is:SQL codeSelect * from RecEngineBizInfo where RecEngineBizNam
MS SQL implementation verifies whether a string contains uppercase and lowercase features
A small feature was implemented last night, in MS SQL Server, to check whether the string contains uppercase and lowercase letters. Usually applied to the complexity of the string.
DECLARE @s NVARCHAR (+) = N ' Sdffggryjhh
The default in the SQL statement is case-insensitive, so the statement:
SQL code
SELECT * from recenginebizinfo WHERE recenginebizname = ' QQ '
And
SQL code
SELECT * from recenginebizinfo WHERE recenginebizname = ' QQ '
The results found are the same.
The script to see if a field contains uppercase A is:
Tags: and led jpg sele src share IMA batch update tdeToday in the pre-trial completion times the following error is caused because the SQL Server data field is lowercase and the Oracle database is capitalized.How to solve this problem, very simple. The SQL is posted here.1. Identify the production model with lowercase letters-only filter the rigid board, not included in the FPC--identify the production mode
SQL Server function converts renminbi numbers to uppercase
CREATE FUNCTION [dbo]. [F_num_chn] (@num numeric (14,5))
RETURNS varchar with encryption
As
BEGIN
DECLARE @n_data VARCHAR (VARCHAR), @c_data (a), @n_str VARCHAR (a), @i int
SET @n_data =right (+cast (ABS (@num *100) as bigint) as varchar (20)), 14
SET @c_data = '
SET @i=1
While @i
BEGIN
SET @n_str =substring (@n_data, @i,1)
IF @n_str
B
Tags: complex declare code event lap server case blocks SRCLast night there was a small function, that is, in MS SQL Server, check whether the string contains uppercase and lowercase letters. The complexity of the string is usually applied. DECLARE @s NVARCHAR( +)=N'Sdffggryjhhtyuj'
IF LOWER(@s) COLLATE Latin1_General_CS_AS @s and UPPER(@s) COLLATE Latin1_General_CS_AS @s
PRINT 'T'
ELSE
PRINT 'F
Create function [dbo].[Fn_getformatmoney](@moneyNumeric -,2))returns nvarchar( +) asbegin Declare @money_num nvarchar( -)--the character form in which the amount is stored,@money_chn nvarchar( +)--to store the amount in Chinese capital form,@n_chn nvarchar(1),@i int --Temp Variable Select @money_chn= Case when @money>=0 Then "' Else NULL End , @money=ABS(@money) , @money_num=Stuff(Str(@money, the,2), -,1,"')--Add the front space to get it in place (minus the decimal poi
DECLARE @name varchar, @newname varchar (@colname varchar)
DECLARE ABC cursor for
Select (a.[name] + '. ' + b.[name]) as TableName, b.[name] colname
From dbo.sysobjects A, dbo.syscolumns b where a.id = b.ID
and a.xtype= ' U '
Open ABC
Fetch next from ABC into @name, @colname
While @ @fetch_status =0 begin
Set @newname =Upper (@colname)
EXEC sp_rename @name, @newname, [COLUMN] Print @colname print @NEWNAME
Fetch next from ABC into @name, @colnam
The default in SQL statements is case-insensitive, so the statement:SQL codeSELECT * from recenginebizinfo WHERE recenginebizname = ' QQ 'AndSQL codeSELECT * from recenginebizinfo WHERE recenginebizname = ' QQ 'The results are the same.The script to see if a field contains uppercase A is:SQL codeSELECT * from Recenginebizinfo where recenginebizname collate chinese_prc_cs_as_ws like '%a% 'Www.jb51.netThe scr
There are many ways to achieve the effect. Here we use the regular expression of Js to process it.
There are many ways to achieve the effect. Here we use the regular expression of Js to process it.
The Code is as follows:
/*
-- Set uppercase letters for the first character string in SQLServer:
-- Author: jinjazz/csdn
-- Enable OLEAutomation in SQLServer2005
Sp_configure 'show advanced options', 1;
Go
RECONFIGURE;
Go
Sp_configure 'ole Automation Proce
Copy codeThe Code is as follows :/*
-- Set uppercase letters for the first character string in SQLServer:
-- Author: jinjazz/csdn
-- Enable OLEAutomation in SQLServer2005
Sp_configure 'show advanced options', 1;
Go
RECONFIGURE;
Go
Sp_configure 'ole Automation Procedures ', 1;
Go
RECONFIGURE;
Go
*/
Use tempdb
Go
If (object_id ('fn _ toTitleCase ') is not null)
Drop function dbo. fn_toTitleCase
Go
Create function fn_toTitleCase (@ inStr varchar (8000 ))
/********************************************************Version: 1.0Creation Time: 20020227Modification Time:Function: Lowercase amount converted to uppercaseParameter: N_lowermoney lowercase amountV_transtype Type--1:directly translate, 0:read it in wordsOutput: Uppercase Amount********************************************************/if exists (SELECT * from dbo.sysobjects WHERE id = object_id (N ' [dbo].[ L2U] ') and xtype in (n ' FN ', n ' IF ', n
Tags: IV TE rom integration into Mes RAC bin likeBecause SQL Server allows lowercase entry, causing the database to exist in lowercase, in data integration to MES or ERP times error, Oracle requires capitalization to cause,To be converted to uppercase, all lowercase data can be queried and updated by the following statement.SELECT * fromPpeflowWHEREPdctno like '%[a-z]%'COLLATE Chinese_prc_bin and LEN(Pdctn
1. Enter Tools-->execute commands-->edit/run script, execute the following scripts to achieve all the fields to capitalize;Option ExplicitValidationmode = TrueInteractivemode = Im_batchDim MDL ' current model' Get current modelSet mdl = ActivemodelIf (MDL is Nothing) thenMsgBox "Not open a model"ElseIf not MDL. IsKindOf (Pdpdm.cls_model) ThenMsgBox "The current model is not a PDM"Else' Call handlerProcessFolder MDLEnd If' handler calledPrivate Sub ProcessFolder (folder)Dim Tab ' table to be proc
The phpucwords () function converts the first character of each word in a string to uppercase (implementation code) and ucwords to uppercase. The phpucwords () function converts the first character of each word in a string to uppercase (implementation code), and the ucwords capital phpucwords () function converts the first character of each word in a string to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.