Assuming SQL Server:
e.g. if you class special characters as anything NOT alphanumeric:
DECLARE @MyString VARCHAR(100)
SET @MyString = 'adgkjb$'
IF (@MyString LIKE '%[^a-zA-Z0-9]%')
PRINT 'Contains "special" characters'
ELSE
PRINT 'Does not contain "special" characters'
Just add to other characters you don’t class as special, inside the square brackets
Related Contents:
- Select statement to find duplicates on certain fields
- T-SQL Cast versus Convert
- Convert Datetime column from UTC to local time in select statement
- When to use Common Table Expression (CTE)
- How do I create a foreign key in SQL Server?
- Inserting data into a temporary table
- Change Schema Name Of Table In SQL
- How to calculate age (in years) based on Date of Birth and getDate()
- Why does using an Underscore character in a LIKE filter give me all the results?
- How do I drop table variables in SQL-Server? Should I even do this?
- Getting result of dynamic SQL into a variable for sql-server
- How to assign an exec result to a sql variable?
- Is there a way to list open transactions on SQL Server 2000 database?
- How to print GETDATE() in SQL Server with milliseconds in time?
- SQL Row_Number() function in Where Clause
- How to copy a row from one SQL Server table to another
- How do you update a DateTime field in T-SQL?
- ORDER BY items must appear in the select list if SELECT DISTINCT is specified
- SQL Server Invalid Column name after adding new column
- Get Table and Index storage size in sql server
- Create parameterized VIEW in SQL Server 2008
- SQL Join Table Naming Convention [closed]
- What is the equivalent of the Oracle “Dual” table in MS SqlServer?
- Using tuples in SQL “IN” clause
- Inner Joining three tables
- SQL Server: IF EXISTS ; ELSE
- SQL Server find and replace specific word in all rows of specific column
- How to select data of a table from another database in SQL Server?
- How do I determine if a database role exists in SQL Server?
- Postgres Case Sensitivity
- My Select SUM query returns null. It should return 0
- What’s the SQL national character (NCHAR) datatype really for?
- DateTimeOffset.Now in T-SQL
- SQL DATEPART(dw,date) need monday = 1 and sunday = 7
- How do you strip a character out of a column in SQL Server?
- Using DISTINCT and TOP in the same query
- SQL: How do I use parameter for TOP like in SELECT TOP @amount? [duplicate]
- SQL server identity column values start at 0 instead of 1
- SQL Server Count is slow
- Arithmetic overflow error when summing an INT, how do I cast it as a BIGINT?
- How to create table using select query in SQL Server?
- Trim spaces in string – LTRIM RTRIM not working
- SQL, How to Concatenate results?
- How do I list user defined types in a SQL Server database?
- How can I see all the “special” characters permissible in a varchar or char field in SQL Server? [closed]
- When to use EXCEPT as opposed to NOT EXISTS in Transact SQL?
- Debugging stored procedures in SQL Server Management Studio
- SQL Server Left Join With ‘Or’ Operator
- In SQL Azure how can I create a read only user
- How can I find Unicode/non-ASCII characters in an NTEXT field in a SQL Server 2005 table?