Find All Special Characters in a SQL Server

I would like to find all Special Characters in a table. I am currently using the code below. Not sure if this gets all of them.
select  top 50 *
from [dbo].[SV20150122]
where street LIKE '%[^0-9a-zA-Z @\.\-]%'
SQL

Depends on what you want to count as a special character.  Depending on your collation, your query might not consider é (for example) as a special character.  The same goes for other accented letters.  If that's what you want, then fine. 
If that is not what you want, you may want to do
where street LIKE '%[^0-9a-zA-Z @\.\-]%' Collate Latin1_General_BIN
In any case, you can see exactly which characters are NOT counted as special characters on your system (with and without the Collate clause) by running
Declare @Test Table(ID int, MyData char(1));
;With cte As
(Select 0 As Number
Union All
Select Number + 1
From cte
Where Number < 255)
Insert @Test(ID, MyData)
Select Number, CHAR(Number)
From cte Option(MaxRecursion 256);
Select ID, MyData From @Test
Except
Select ID, MyData From @Test
Where MyData LIKE '%[^0-9a-zA-Z @\.\-]%'
Select ID, MyData From @Test
Except
Select ID, MyData From @Test
Where MyData LIKE '%[^0-9a-zA-Z @\.\-]%' Collate Latin1_General_BIN
Note: the above code assumes the column street is char or varchar. 
Tom

Similar Messages

  • How to find a record then edit using sql server management studio

    Hello,
    A very basic question:
    I want to find a record stored in MS SQL Server 2008 express database table then edit the record.
    I tried to do it using SQL Server 2008 management studio express because I have been using MS Access database all the time. I have right clicked the table in management studio, clicked the "Edit top 200 records" menu item then when records were
    displayed on the result pane, I pressed Ctrl + F key to find a student named Simon for example. Well, nothing happened. I couldn't see any dialog boxes for putting in the search criteria.
    I guess I cannot simply use Ctrl+F in SQL Server management studio to find / edit a record.
    Can someone please teach me how to find a record specifying a search criteria then edit the record in SQL server management studio?

    Hi ZKM128,
    I have not seen Ctrl+F to be used to look for desired rows in Sql server.
    On the result pane after you selected "Edit top 200 records", just right click , select
    PANE, SQL, you will get the T-Sql query t,here you need to mention the exact criteria which you are looking for, and then you will get the desired rows and then you can edit.
    Thanks
    Manish
    Please use Marked as Answer if my post solved your problem and use
    Vote As Helpful if a post was useful.

  • Cannot find where to download Gateway for SQL Server

    I have searched OTN every which way to find the Oracle Transparent Gateway for SQL Server. I have checked my CD's and I have every one imaginable but not the one for SQL server. Why? Where is it hidden? I am trying to connect to a SQL Server 6.0 and an Oracle 8.1.6.3 Database at the same time.
    [email protected]

    Hello,
    All of the downloads are [url http://www.oracle.com/technology/software/products/jdev/htdocs/soft11.html]here. According to the [url http://www.oracle.com/technology/products/jdev/collateral/papers/11/certification/index.html]certification page, JDev 11.1.1.3 is certified against Windows 2008 server, so I'd start by downloading the Windows version from there (even though they didn't update the description to say "for windows 2008")
    John

  • Store&read chinese characters in MS SQL server 2000 using Java

    Hi,
    I have a problem to store Chinese characters in MS SQL Server 2000, storing question marks(??????) instead of Chinese characters
    I am using JSF framework, SUN APPLICATION Server 9.1 , MS SQL Server 2000 server and Microsoft data source driver class (com.microsoft.sqlserver.jdbc.SQLServerDataSource) to connect db.
    I have one solution:
    IN JSP:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    and
    In database column type should “nvarchar” in place of varchar
    while inserting or updating the same need to add ‘N’ prefix with the value like insert into client(Name, Id ….) values (N+)
    the above is working fine but the problem is here i have already defined database with 100s of tables I cant change database tables as well as queries
    Thanks,
    Sathi

    I don't know any betterer option, than to copy the database tabels redefining the Chinese data fields as nvarchar.
    To be frank I had also problems writing to a html file Chinese text stored in MS SQLServer 2000 nvarchar fields.
    The following worked:'
         public String getEncodedData(ResultSet resultSet, int columnIndex, String charset)
         throws SQLException
              //final String methodName = "getEncodedData";
              InputStream binaryStream =resultSet.getBinaryStream(columnIndex);
              String readStringFromStream=readStringFromStream(binaryStream, charset);//UTF_16LE);
              return readStringFromStream;
         public String readStringFromStream(InputStream inputStream, String charset) {
              final String methodName = "readStringFromStream";
              StringBuffer buffer = new StringBuffer();
              try {
                   int ch;
                   InputStreamReader isr = new InputStreamReader(inputStream, charset);
                   Reader in = new BufferedReader(isr);
                   while ((ch = in.read()) > -1) {
                        buffer.append((char)ch);
                   in.close();
                   return buffer.toString();
              } catch (IOException exception) {
                   Log.printError(this,methodName, exception);
                   return null;
         }And writing it to file:
         public void writeEncodedStringToFile(String text, String filePath, String charset, boolean append){
              final String methodName = "writeEncodedStringToFile";
              OutputStreamWriter writer= null;
              try {
                   FileOutputStream fileOutputStream = new FileOutputStream(filePath, append);
                   writer = new OutputStreamWriter(fileOutputStream, charset);
                   writer.write(text);
              } catch (IOException exception) {
                   Log.printError(this,methodName, exception);
              }finally{
                   try {
                        writer.close();
                   } catch (IOException exception) {
                        Log.printError(this,methodName, exception);
         }Edited by: astlanda on Feb 10, 2009 11:13 PM
    Edited by: astlanda on Feb 10, 2009 11:21 PM

  • How to find the 'special characters' window

    Hi,
    Frequently I want to access the 'special characters' window, but when I click on the 'special characters' menu item the window does not appear. Sometimes I later find it on another screen (I use nine screens in Spaces), and sometimes can I see it on another screen using Expose, but when I go there it has disappeared. It seems a very fugitive tool, and in its way displays some cute, personality........ But I would love to know how to find it or to force it to appear on the same screen as the application from which I tried to open it!
    all the best,
    Jeremy Harbinson

    Hi,
    Thanks for the reply.
    I tried what you suggest - in the International section of the System Preferences there is a tab labelled 'input menu' and there is a check box (which is checked) titled 'Show input menu in Menu bar'. Unchecking that removes a national flag from the the menu bar, checking it restores that flag. So far, so good. If a click on the flag, a drop down menu appears with 'Hide character palette' as an item - clicking this changes it state to 'Show character palette' but clicking this (several times) changes nothing else that I can see,
    all the best,
    Jeremy

  • Find all Skew characters

    Hi ALL,
    Is it possible to find the Skew content in the document???
    For example, if the skew is like as 1 to 180 etc.,
    We can catch the skew characters like as below only
    app.findTextPreferences.skew = 8;       //this is possible
    app.findTextPreferences.skew = -20;    //this is possible
    Thanks in advance
    Siraj 

    @Chinna – you can skew a text by -1.5 .
    So it seems to be best:
    If you do not have assigned any character styles:
    1. First find all not skewed text and assign a character style
    2. Search for text with character style "None" => all found texts are skewed by some value
    Or, if there are already character styles into play:
    1. First find all not skewed text and change the value of a property, that is never set to a special value throughout all texts in your document. Set this property to a special value.
    2. Do a search where this value is set to default => all found texts are skewed by some value!
    Here some code to show this with the property strikeThru that should be not used in the text!
    Find a different one that is working with findTextPrefernces or changeTextPreferences, if you are using strikeThru in the formatting of your text!
    //strikeThru is NOT used in the document!
    var mySkope = app.documents[0];
    app.findTextPreferences = app.changeTextPreferences = null;
    //First find all text that is not skewed:
    app.findTextPreferences.skew = 0;
    //Format the found text with a property not used in the text:
    app.changeTextPreferences.strikeThru = true;
    mySkope.changeText();
    app.findTextPreferences = app.changeTextPreferences = null;
    //Find all text that is not set with that property.
    //THAT must be the text skewed in various angles:
    app.findTextPreferences.strikeThru = false;
    var mySkewedTextsArray = mySkope.findText();
    app.findTextPreferences = app.changeTextPreferences = null;
    //Skewed texts contents written to console:
    //Or do here something else with the skewed text!
    for(var n=0; n<mySkewedTextsArray.length;n++){
        $.writeln(mySkewedTextsArray[n].contents);
    //Reset the property used for the not-skewed text:
    app.findTextPreferences.strikeThru = true;
    app.changeTextPreferences.strikeThru = false;
    mySkope.changeText();
    app.findTextPreferences = app.changeTextPreferences = null;
    Uwe

  • How to ignore special characters in Logical SQL.

    Hi Experts,
    I am using Logical SQL generated from BI Answers in dataset of BIP Data model.
    The column name or presentation table name contains special character as “&, %’
    So when I try to create dataset using suppose following Logical SQL, I am getting prompt/error as
    “Please enter values for lexical references in SQL
    *~ description"."security name" s_9, ”
    Could you please suggest what should I do to ignore these special characters?
    SELECT
    0 s_0,
    "TEST_RPD"."Account"."As Of Date" s_1,
    "TEST_RPD"."Security Identifier & Description"."Security Name" s_9,
    "TEST_RPD"."Statistics"."Quality - S&P Rating" s_26,
    "TEST_RPD"."Statistics"."Yield To Maturity" s_27
    FROM "TEST_RPD"
    WHERE
    (("Account"."As Of Date" = date '2011-01-31') AND ("Account"."Report Account ID" = '1733'))

    Thanks..That is what we did in RPD.
    I was looking for any other approach as our RPD is shared between OBIEE and BIP.

  • Replace all special characters in a String with underscore

    I have a String which contains some special characters even(!,$,@,*....).
    I need to replace all the special characters with _ in my String. I do have an idea of using String.replace() and analogous forms, but I would be thankful if anyone can suggest me of a better and an efficient way.
    regards,
    fun_one

    Kaj,
    Thx for your earnest reply. I did have a peep into the API on this method. But the regular expression that I need to use here was beyond my understanding. It did specify some regex that I put to use (something like myString("\D","_"), assuming that I need to replace all non-digit characters ), but it really did not help me getting the result.
    Would you spare some code for me reg. the usage of regular expressions in such a scenario?
    cheers,
    fun_one

  • How to remove all special  characters

    Hi,
    I want to remove all (128-223)the special characters that come in the mapping from the URL
    http://www.danshort.com/ASCIImap/
    128-223 ,I mean if any characters that come in between these numbered characters I have to remove in mapping.
    please suggest.
    thank you,
    Sri

    HI Sri
    You can use the Java code as given above
    Other method can be XSLT
      <xsl:stylesheet  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
                <xsl:output  method="xml" indent="yes" omit-xml-declaration="yes"/>
                <xsl:template  match="/source node">
                      <target node>
                            <xsl:value-of  select="replace(.,'sepcial character','')"/>
                      </target node>
                </xsl:template>
          </xsl:stylesheet>
    Thanks
    Gaurav

  • Special Column names in SQL Server

    Hi,
    I am trying to use ODI to load data from SQL Server to Oracle. My problem is having special column names in the old SQL Server database. The columns have names such as 9500Column1. I tried enclosing the names with square barckets in the model definition but it did not work.
    Any ideas? Any modifications I might make to the LKM?
    Nimrod

    Try enclosing the special fields in double quotes instead of [ and ]. Yes, that isn't the T-SQL standard, but it works, even in SS Studio.
    I had a SELECT statement in a Procedure that died when it hit a space in the column name. After hours of unsuccessful attempts to escape [ and ] it occurred to me that maybe " and " would do the trick as that is the PL/SQL standard. I think the proverbial feather could have knocked me over. Or was that me kicking my self in the rear?
    Regards,
    Cameron Lackpour

  • Migrating Japanese Characters from MS SQL Server 2000 to Oracle 9i usng Jsp

    Hi ,
    I have a situation where the Japanese characters are to be migrated from MS SQL Server 2000 to Oracle 91 and then render the same using JSP.
    I followed the below approach,
    1. Extract the Japanese data from MS SQL Server and generate an XML
    2. Parse the XML and store it into Oracle 9i database which is of UTF-8 encoding.
    3. On retreiving and rendering using the Shift-JIS adds few junk characters additionally.
    When I try to copy paste the Japanese contents from XML to a text file, it is working fine.
    Could some one help me in resolving this issue?
    It is very urgent, and any help would be greatly appreciated.

    There is documentation in the reference guide sent with the workbench, there is this discussion forum, the support web page (which includes tech notes and FAQ's), and the company specific procedural language documentation.
    There is also an older document for use with the old sybase toolkits which may be obscelete, and there are some internal documents which were for internal consumption.
    Turloch
    Oracle Migration Workbench Team

  • Identify and show Special Characters in the SQL result set

    Hi all,
    The values in a column (SC - colunm name) has special characters. For eg. 496+>9, 223'32, 167&45. Is there any function in Oracle that would give me the below result when i query that colum.
    select SC from xyz;
    Result should be as follows:
    496+&gt;9
    223&apos;32
    167&amp;45
    Thanks in advance.

    yes it will have numbers and characters also along with the special characters
    The results from my previous post was wrong. Here is the expected results;
    496+&gt;9
    223&apos;32
    167&amp;45
    can you give me the exact query to get the above resultant.
    Thank you

  • Can you help me find my special characters?

    I have used special characters without any hitch in the past. But now I can't bring them up at all.  Not in Pages, or in Mail.  Can anyone suggest a solution?  I'm using a rather old 12"  iBook G4.

    Tom Gewecke wrote:
    Dewi Gregory wrote:
    Don't do this if you don't want to lose everything on your desktop
    That's strange!  This was a very common problem and fix several years ago when 10.5 came out and I don't remember hearing of anyone losing anything.
    Me too Tom
    But it's easy to get odd behavior with the terminal. One added letter or a dropped one may make a huge difference.
    It's why I encapsulate calls to terminal in a Do Shell Script  instruction.
    This may I may easily triple check it before execution.
    Yvan KOENIG (VALLAURIS, France) mercredi 20 juillet 2011 16:17:51
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • How to find open query executed once on SQL server

    Hi Experts ,
    Is there any way to identify that open query executed once on Db server using any DMv's ? we are planning enabale opimized for ad-hoc queries on SQL server ?
    Shivraj Patil.

    Hi,
    You can use below query  to find the plans that have been used only once.
    SELECT text, cp.objtype, cp.size_in_bytes
    FROM sys.dm_exec_cached_plans AS cp
    CROSS APPLY sys.dm_exec_sql_text(cp.plan_handle) st
    WHERE cp.cacheobjtype = N'Compiled Plan'
    AND cp.objtype IN(N'Adhoc', N'Prepared')
    AND cp.usecounts = 1
    ORDER BY cp.size_in_bytes DESC
    OPTION (RECOMPILE);
    additionally you can also refer below articles.
    http://sqlmag.com/database-performance-tuning/sql-server-plan-cache-junk-drawer-your-queries
    Plan cache and optimizing for adhoc workloads
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    Praveen Dsa | MCITP - Database Administrator 2008 |
    My Blog | My Page

  • Where to find the API documentation for MS SQL Server 2000 JDBC

    I Downloaded and installed the MS SQL Server 2000 JDBC package, but I found that it does not provide enough help docs such as API documentation, demo and etc.
    It would be most grateful if you would provide some information about this driver.

    Thank your for your kind attention.
    For example, I want to get a ConnectionPoolDataSource object to get a PooledConnection object, but I don't know which class implements the interface.
    import java.sql.*;
    import javax.sql.*;
    import <classes related to connection pooling>;
    ConnectionPoolDataSource cpds = new <MS impl>;
    <lines for setURL()/setUser()/setPassword, etc>
    PooledConnection pc = cpds.getPooledConnection();
    ...

Maybe you are looking for

  • Latest update won't install

    I'm not computer literate, so any help will have to be worded as if you're writing it for an idiot, which is not far from the truth! Last night in trying to play World of Warcraft, I got an error message at the games logon and it said I should be usi

  • System requiremen​t for Labview run-time engine 8.6

    Hello is there any system requirements for LabVIEW Run-time engine 8.6? for example, same system requirements for LabVIEW 8.6? Internet Explorer 5 is fine? or Internet Explorer 6.0 or higher is fine? Does it work for Firefox on an Athena Linux mechin

  • Currency issue - decimals moved to the left

    Hello gurus, I have an issue with an upload from a flat file. All of the key figures are upload corectly except 1 (YEN), It is uploaded with 2 decimals inside the numer. EX: In the file is 100,00 YEN  and after upload is 10000,00 YEN. How can I chang

  • Standards or best practises for Java imports?

    I was just wondering how some of the more seasoned developers out there handle Java imports. I'm fairly new to Java programming and as far as I know there is very little difference between explicitly importing individual classes and importing entire

  • REPAIR FAILURE

    I have sent my ipod video in for a repair on some burnt out pixles and it is currently getting sent in the mail back to me and apple is claiming it had no problem, I would like to know what apple is going to do to resolve this issue, because i sent t