Fetching case sensitive emails in SQL Server

Dear SQL experts,
I am a novice and only recently started using SQL. I've been tasked with finding all emails that are capitalised in our data base. Please could you help in how i can do this.
Thanks,
Hobsonite

Does this help?
declare @a varchar(100)='aA'
IF lower(@a) != @a COLLATE Latin1_General_CS_AS
PRINT 'Upper case found'
Go
declare @a varchar(100)='AA'
IF lower(@a) != @a COLLATE Latin1_General_CS_AS
PRINT 'Upper case found'
Go
declare @a varchar(100)='aa'
IF lower(@a) != @a COLLATE Latin1_General_CS_AS
PRINT 'Upper case found'
You could do a similar logic to find any emails having upper case characters in the email column
Satheesh
My Blog |
How to ask questions in technical forum

Similar Messages

  • Fetch data from another mirosoft sql server to sap

    Dear all,
                   I want to fetch data from another mirosoft sql server
                    to SAP(my sap server IN unix, oracle 10g).
    Thanks
    Shashi
    Moderator Message: Try to do you own research before posting your question. Get back to the forums in case you are stuck with any issue
    Edited by: Suhas Saha on Jul 26, 2011 3:21 PM

    hi,
    u should see following documentation:
    Oracle9i Heterogeneous Connectivity Administrator's Guide
    Release 1 (9.0.1)
    Part Number A88789_01
    in it u just go to chapter no. 4 (using the gateway),,u'll find ur answer there.
    regards
    umar

  • Help to resolve error in sending database email from SQL Server 2012.

    Please help to resolve error in sending email from SQL Server 2012.
    SQL Instance Version:
    Microsoft SQL Server 2012 (SP1) - 11.0.3449.0 (X64) 
    Jun 29 2014 23:15:18 
    Copyright (c) Microsoft Corporation
    Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.3 <X64> (Build 9600: )
    Error Message: Error MeThe mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2015-01-15T19:48:25). Exception Message:
    Cannot send mails to mail server. (The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.1 Client was not authenticated).)

    The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.1
    Client was not authenticated).
    I think the error message is pretty clear, you have to setup authentication for the SMTP connection in Database Mail, see
    Database Mail Configuration Objects
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How to select a case sensitive value in SQL with C#

    Hello,
    I have an application that at the begining a user will login with a user name and password which is stored in the database. The SQL statement is as follows:
    "SELECT id_employee FROM employee WHERE employee_number='" + txtUserName.Text + "' AND passWord='" + txtPassword.Text + "'";
    For testing purposes I have set the password to the word test.   The problem is, if the user enters in TEST or TeSt or TESt  it will grant them access. How do I set it to force the correct case?
    I am using SQL 2005 for the database.
    Thanks!
    ~zero

    You can also set Collation while comparing strings:
    "SELECT id_employee FROM employee WHERE employee_number='" + txtUserName.Text + "' COLLATE Latin1_General_CS_AS AND passWord='" + txtPassword.Text + "'  COLLATE Latin1_General_CS_AS";
    All comments about not doing this type of quering using command string, instead of command with parameters, they are apsolutely right.
    Nevertheless i will have only username as a parameter in the command and password will be return value from procedure. I will check for equality of entered password and returned one from command in C# code, and C# is case sensitive. There is a good security model implemented for password in AdventureWorks sample database for SQL Server 2005, in table Person.Contact.
    That model use two fields for password, PasswordHash and PasswordSalt. PasswordSalt is randomly generated hash when password is modified and with that salt, password string is encrypted, which produce PasswordHash. So when you want to authenticate a user, execute a command that will return a row(PasswordHash and PasswordSalt) for entered username, and in application you will encrypt entered username with PasswordSalt. If generated string is equal with the one returned PasswordHash, then you have a valid login. If nothing is returned from command or they are not equal, you have invalid login.

  • Case sensitive issue CF7 & SQL 2005

    I had to rebuild a database from a backup recently. Now I am having a case sensitive issue in my queries that I did not have before.
    The following use to work with Rockmart in lowercase even though Rockmart was in the table as all uppercase like so ROCKMART.
    <cfquery name="updateAreas" datasource="mySource">
       UPDATE Property
       SET AR = 3610
       WHERE  City = 'Rockmart'
    </cfquery>
    The above has stopped working now the query must specify ROCKMART because it is in the table in all upper case.
    My database option is set to SQL_Latin1_General_CP1_CI_AS
    Any ideas.
    Many thanks for you help.
    Brian

    A collation can be specified at the server, database, and column level in SQL server.  The column collation will take precedence over the database collation.  Check that the collation for the column is case-insensitive.  You can use the query below to get the column's collation.
    SELECT COLUMN_NAME, COLLATION_NAME
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_NAME = 'Property'
        AND COLUMN_NAME = 'City'
    You can get info on the collations supported by SQL Server at:
    http://msdn.microsoft.com/en-us/library/ms144250%28SQL.90%29.aspx
    You can change a column's collation if you need to, but you should be sure that this will not affect any other applications which query the same data.  Another option is to specify the desired collation in your query as suggested by glynjackson.
    http://msdn.microsoft.com/en-us/library/ms190920%28SQL.90%29.aspx

  • How can change Case Sensitivity in MS SQL 2008

    hi expert,
    I want to change Case Sensitivity to Case Insensitivity  in MS SQL 2008.
    how can I do??
    any help please
    thanks and regards
    jun

    Hello,
    there is no way to change this. The SQL Server itself and the SAP Database are installed in an case sensitive collation. If you were albe to change this, your installation will be no longer supported and will, in the worst case, generate incorrect data within the SAP database.
    So, start live with it, there is no way to change it.
    Best regards
    Clas

  • Problem with Sensitive ResultSet in SQL Server 2000

    Hi,
    I am trying to use SCROLL_SENSITIVE and CONCUR_UPDATABLE ResultSet accessing SQL Server 2000. I am using JDK 1.3 and supported JDBC driver. When I tried to insert a row, I got the following message:
    sp_cursor: The cursor identifier value provided (0) is not valid
    Is there any setting in SQL Server that I need to configure or do I miss something in my code?
    Thanks,
    Andi Setiyadi
    Here are my codes:
    cs = connection.prepareCall("{call sp_deptInfo (?,?,?)}", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    cs.setInt(1, 0);
    cs.setString(2, "");
    cs.setString(3, "name/orderbyid");
    rs = cs.executeQuery();
    rs.last();
    int rows = rs.getRow();
    rs.afterLast();
    rs.moveToInsertRow();
    rs.updateInt(1, rows + 1);
    rs.updateInt(2, Integer.parseInt(parentDept));
    rs.updateString(3, newDept);
    rs.updateInt(4, 1);
    rs.insertRow();

    I am getting the resultset by calling a stored procedure. I am not changing the stored procedure itself.Database drivers create 'connections' and 'statements' which match the SQL that you pass it. You are passing it a stored proc. The only information that it has is on a stored proc. It doesn't matter where the stored proc got its info from. The stored proc doesn't return tables and indexes into tables. It returns a result set (that is what your code suggests.) That is all the information that the driver has.
    Consider your stored proc might return this
    select * from mytable where ....
    But it could also do this
    select 'value1', 'value2', ... from dual
    On the java side it isn't not going to know which of the above that you did. Nor should it. And you can't update/insert into that second example.
    Or at least that is how I look at it.
    Your code looks like it is trying to 'update' the result set that a stored proc returned. And I simply don't see how that is possible. Or even why anyone would want to do it.

  • Can SQL Server Express Send Emails?

    I am fiddling around with one of my SQL Server Express instances, and I'm trying to get it to send me an email.  I just read these links.
    http://execsql.org/configure-send-database-email-sql-server-2012-express-edition
    http://www.databasejournal.com/features/mssql/article.php/3626056/Database-Mail-in-SQL-Server-2005.htm
    I followed all the steps there, and now, as I'm trying to send myself an email, I get this message.
    The mail could not be sent to the recipients because of the mail server failure. Exception Message: Could not connect to mail server.
    When I run this:
    SELECT * FROM msdb.dbo.sysmail_event_log;
    I see this:
    description
    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2015-01-21T14:25:36). Exception Message: Could not connect to mail server. (The requested name is valid, but no data of the requested type was found).
    Any idea what's wrong?  Can SQL Server Express even send emails???
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Hello,
    You can make use of CLR Integration for sending email from SQL Server Express.
    http://www.sqlservercentral.com/articles/SQL+Server+Express/71341/
    http://www.vnypatel.com/sending-emails-with-clr-sql-server-express-editions
    SQL Server Express does not support database mail.
    https://msdn.microsoft.com/en-us/library/cc645993.aspx
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Sql server email

    Hi all,
    I have a question regarding the stored procedure results. I have two stored procedures. stored procedure  [spSync_Prod2Dev] and stored [dbo].[SpEmail_spSync_Prod2Dev]. Here stored procedure  [spSync_Prod2Dev] will load data from Production to DEV,
    this will be done every week. So ones it runs I should get an email "data loaded successfull" For this I have created another stored procedure called stored [dbo].[SpEmail_spSync_Prod2Dev], So ones stored procedure runs
    exec [dbo].[SpEmail_spSync_Prod2Dev]  this stored proc this willgenerate a result values either it's 0 -1 or 1 based on this output it should call this stored procedure [spSync_Prod2Dev]. If the [SpEmail_spSync_Prod2Dev] result is 0 then
    it should email me an "Error message" and if the [SpEmail_spSync_Prod2Dev] result is success (1) it should go the this  [spSync_Prod2Dev]. stored proc and it should execute the SP ,and get an success email "Data loaded".
    Could you please help me on this. And I think I am clear if not you can ask me for questions.
    Thanks,
    sidhu

    Why not use a Try Catch for this???
    USE [YOUR_DB]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[Table_Name]
    AS
    BEGIN TRY
    INSERT [dbo].[Table_Production]
    Select *
    FROM [dbo].[Table_Staging]
    SET NOCOUNT ON
    declare @RowCount as int
    declare @EmailBody as varchar(1000)
    SELECT @RowCount = count(*) FROM [dbo].[Table_Staging]
    set @EmailBody = 'Successfully Loaded TABLE' + cast(@RowCount as varchar(50)) + ' records loaded'
    IF @RowCount > 0
    BEGIN
    exec msdb.dbo.sp_send_dbmail @profile_name = 'MailTest',
    @recipients = '[email protected]',
    @subject = 'Successfully Production',
    @body = @EmailBody,
    @body_format = 'HTML'
    END
    END TRY
    BEGIN CATCH
    -- SELECT ERROR_NUMBER() AS ErrorNumber;
    exec msdb.dbo.sp_send_dbmail @profile_name = 'MailTest',
    @recipients = '[email protected]',
    @subject = 'WARNING did NOT load Production',
    @body = 'WARNING did NOT load Production + @@RowCount ',
    @body_format = 'HTML'
    END CATCH;
    Please see these links for more info.
    http://www.sqlservercentral.com/blogs/querying-microsoft-sql-server/2013/09/02/sending-mail-using-sql-server-express-edition/
    http://www.dotnet-tricks.com/Tutorial/sqlserver/4761260812-Remove-unsent-database-email-from-SQL-Server.html
    http://www.mytechmantra.com/LearnSQLServer/Troubleshooting-SQL-Server-blocked-access-to-procedure-sp_send_dbmail.html
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Objects name case sensitive

    Hi Dear;
    to call any object in SDK, i have to write the object name(index) as case sensitive.
    if there any way to call these objects without case sensitive?
    Ex: if i have a UDF named U_BPDrv and i try to get it as U_BPDRV i get an error.
    how can i resolve this error?
    thank you Dear;

    Hi Lita,
    i tried it now. UDF field is named as u_Test.
    When I call SELECT ordr.u_Test so the result is the same as when I call SELECT ordr.U_TESt, so here is it not case sensitive. When I try get result from recordset as rs_ordr.Fields.Item("U_TeSt").Value() it give no error. When I bound result from recordset to matrix as
    column.DataBind.SetBound(True, "@KZ", "u_TEst") - no error as well.
    Everything was tested with no binary collation on db.
    So I`m persuaded, that in this cases it depends on sql server and not on SDK.
    Petr

  • SQL Server 2005 Views data automated.

    Hi Team,
    Very Good morning to you. I am Asif Ali working as Software Engineer in TESCO HSC, Bangalore, India.
    We are using SQL Server 2005 as our database. From the production environment every week I need to fetch weekly data from 3 different views and put into an excel sheet and then I have to mail this. This is a manual work. Is there any way to automate it so
    that every week automatically the report should be sent to email ids, OR is there any way at least every week automatically data is pasted to excel sheet and then manually can be emailed to recipients. Till now: fetching data from view, paste data into an
    excel sheet and then mail that sheet, all three activities are manual. I want to automate this at least at some extent. I am new to SQL Server world. I have knowledge of Java, VB Script and little bit of .NET.
    Please help me on this.
    Thanks in Advance
    Regards,
    Asif Ali
    Contact #  +91- 7204574734, [email protected]

    You can use  a SSIS Package to export the data from SQL to a excel sheet, Here is a simple project you can have a look at it
    http://www.codeproject.com/Articles/402958/SSIS-Package-Export-Data-from-Database-Daily-to-Ne
    Later after you design the SSIS package , you can schedule a SQL Agent job 
    1. The first step will be to run the SSIS package 
    2. Second step to send the email.
    Configure SQL Server Agent
    to know about sending emails from SQL Server have a look at this link
    Send email from SQL
    Satheesh
    My Blog |
    How to ask questions in technical forum

  • Insert data into oracle based on sql server data(here sql server acting as source to oracle and destination to oracle)

    Source is Oralce. Destination is SQL Server.
    Requirement - I have to fetch sql server server data (empid's) based emp table  and send this as input data to oracle to fetch and empid's are common.
    I cannot use merge or loopkup or for each as oracle have too many records.
    For example - In MS SQL - i have empid=1,2..Only these records, I have to fetch from oracle source into sql server destination. For this, I have adopted the below approaches...The major problem I face, when i build a empid's as a string, it is taking only
    4000 chars. My string lenght is 10000. How do I breakup this string lengh and send to data flow task till all broken strings length passed to DFT.
    Approach-1
    created two variables - oraquery string, empid string
    step1 - ms sql database - created sql task - declare @empid varchar(max)
    SELECT @empid=
    Stuff((SELECT ',' + empid
            FROM  
            (SELECT  DISTINCT  convert(varchar(10),empid ) empid FROM emp
             ) x
            For XML PATH ('')),1,1,'')
    select @empid =    '(' +  @empid + ')'
    select @empid
    resultset=singlerow
    resultset=resultname=0; variablename=User::empid (empid is declared as string)
    step2 - oracle database - created data flow task
    created oledb source
    I put  this statemnt in oraquery expression - "select * from dept where dept in  "
    +  @[User::empid] + "
    expression=true
    [OLE DB Source [1]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E14.
    An OLE DB record is available.  Source: "Microsoft OLE DB Provider for Oracle"  Hresult: 0x80040E14  Description: "ORA-00936: missing expression".
    Approach-2
    created three variables - oraquery string, empid  int, loop object--when I put int then it is automatically setting to 0
    step1 - ms sql database - created sql task - SELECT  DISTINCT  convert(varchar(10),empid ) empid FROM emp
    resultset=fullresult
    resultset=resultname=0; variablename=User::loop
    step2 - created a for each loop container
    for loop editor - for each ado ennumerator
    enumerator configuration - loop
    variablemapping - variable=empid;index=0
    step3 - oracle database - created data flow task (outside for each loop. If I put inside it is taking long time)
    created oledb source
    I put  this statemnt in oraquery expression - "select * from dept where dept in  "
    +  @[User::empid] + "
    expression=true
    Data inserting in a destination table but  empid=0.

    Sorry didnt understand if your step3 is outside loop how
    @[User::empid] will get values for the empids from User::loop. The iteration happens inside loop so you
    need to have a logic to form the delimited list inside using a script task or something and concatenating everything and storing to variable @[User::empid]
    . Then only it will have full value used to be used in step3 query
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to pass values to SQL server Agent Job which internally calls SSIS

    Hi,
    I have a requirement where i need to call remotely SSIS package from ASPX. After following MSDN form, I have creaed one SQL server agent job and calling that job from ASPX. I am ablt call SQL server agent job from ASPX. Only issue i am facing is: I need
    to pass 2 variables from ASPX to SQL Agent job so that from Job i can map the same to SSIS Package.
    I am using system SP (sp_start_job) for calling SQL server agent job as mentioned in MSDN forum.
    below is the code , which i am using to call SQL serve agent job.
    Code:
    SqlConnection
    jobConnection;
    SqlCommand jobCommand;
    SqlParameter jobReturnValue;
    SqlParameter jobParameter;
    int jobResult;
                    jobConnection =
    new
    SqlConnection("Server=ServerName;Initial
    Catalog=msdb;Integrated Security=SSPI;user id=username;Password=password");
                    jobCommand =
    new
    SqlCommand("sp_start_job",
    jobConnection);
                    jobCommand.CommandType =
    CommandType.StoredProcedure;
                    jobReturnValue =
    new
    SqlParameter("@RETURN_VALUE",
    SqlDbType.Int);
                    jobReturnValue.Direction =
    ParameterDirection.ReturnValue;
                    jobCommand.Parameters.Add(jobReturnValue);
                    jobParameter =
    new
    SqlParameter("@job_name",
    SqlDbType.VarChar);
                    jobParameter.Direction =
    ParameterDirection.Input;
                    jobCommand.Parameters.Add(jobParameter);
                    jobParameter.Value =
    "ImportCMTData";
                    jobConnection.Open();
                    jobCommand.ExecuteNonQuery();
                    jobResult = (
    Int32)jobCommand.Parameters["@RETURN_VALUE"].Value;
                    jobConnection.Close();
    switch (jobResult)
    case 0:
    Console.WriteLine("SQL
    Server Agent job, RunSISSPackage, started successfully.");
    break;
    default:
    Console.WriteLine("SQL
    Server Agent job, RunSISSPackage, failed to start.");
    break;
    Console.Read();
    Thanks
    Pankaj

    "3-4 concurrent users are calling the SSIS package from ASPX page" this is not a proper design
    If the data is being ingested than it is likely that this concurrency will lead to one of the packages die
    What you shell do is to just queue the data ingress/processing.
    In general, again, packages should not be called from ASP web pages, SSIS is ETL-server side technology there is nothing signalling back to the user whether it was successful. The proper way is to write a REST service or alike. 
    Arthur
    MyBlog
    Twitter

  • Sql Server 2012 Encrypted Connection Accept only Internal IP

    Hi Friends,
    As we are using sqlserver 2012 is it possible we can configure  Sql Server to Accept  connection only internal ip (local) network as wel encrypted connections only , if possible please let me know how we can A chive this .
    thank you.
    Regards,
    asad

    Hello,
    SQL Server TCP/IP protocol is a common protocol widely used over the Internet. It communicates across interconnected networks of computers that have diverse hardware architectures and various operating systems. Named Pipes is a protocol developed for
    local area networks. In this case, you can configure SQL Server only use Named Pipes protocol via SQL Server Configuration Manager.
    Choosing a Network Protocol:
    http://technet.microsoft.com/en-us/library/ms187892(v=sql.105).aspx
    Regards,
    Elvis Long
    TechNet Community Support

  • What will I do with the SQL Server (2012/2014) (Standard/Enterprise) Licenses?

    What will I do with the SQL Server (2012/2014) (Standard/Enterprise) Licenses?
    Are these the same as software product keys, or just some pieces of paper the company needs to have on hand?
    In which case, when we install SQL Server 2014, (and when looked for videos) - there is only 1 product key value to be put in, is there some other screen in the setup to input the License bought ( in our case will be Core licenses).
    So in addition to the Core Licenses do will a Product key be needed? Would product key from an msdn work, as it is the licenses that we will buy to indicate that we bought to run the software on server X?
    Thanks for any indications.

    1. What will I do with the SQL Server (2012/2014) (Standard/Enterprise) Licenses?
    Are these the same as software product keys, or just some pieces of paper the company needs to have on hand?
    2. In which case, when we install SQL Server 2014, (and when looked for videos) - there is only 1 product key value to be put in, is there some other screen in the setup to input the License bought ( in our case will be Core licenses).
    3. So in addition to the Core Licenses do will a Product key be needed? Would product key from an msdn work, as it is the licenses that we will buy to indicate that we bought to run the software on server X?
    Thanks for any indications.
    I will answer your question point wise
    1. Keeping license key is good idea it helps you during audit and you have proof that you are using a valid Microsoft License. Plus in scenario of disaster where whole box gets damanged you might need to install SQL Server again in that case during
    reinstallation on setup page where you need to enter key you might need need it. If you are missing your paper then you are in trouble.
    2. Only on product key page license key is required and it is not required anywhere else during installation. Unless you enter valid product key installation will not proceed further.
    3 License makes you a valid owner of Microsoft product with restrictions on how much hardware resource you can use how much max connections you can make etc. Key lets you install it on Windows machine making sure that you are using valid Microsoft product.
    This was just a general idea please speak to your licensing specialist for more details. This is technical forum and we generally ask user to speak to licensing expert for such queries.
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

Maybe you are looking for

  • How to create a table of figures

    Can someone please tell me how do you create a table of figures in Pages? How about a Bibliography in APA format?

  • Urgent: Lotus Notes and TREX

    Hi, We are planning to use SAP’s TREX to search for word documents and ppts embedded within Lotus Notes. However, we have a couple of queries regarding our requirement and would appreciate your help. 1) Is it possible to use the TREX server for index

  • Apache - Weblogic Plugin

    Hello : How to configure the Apache - Weblogic Plugin in BEA 8.1. I am doing all as per the doc but I am not able to get the result. My configuration RH 7.3, BEA 8.1 , Apache 2.3.9 If somebody have configured could u guys give little insight.. regard

  • Is it safe to download a "free" youtube video converter for MAC and if so, which one is recommended?

    Is it safe to download a "free" Youtube video converter (Ex. "freemake.com") for MAC or is there a better program recommended to convert these videos to DVD?  Thanks!

  • Slideshow audio timing is off after export to QT movie

    I created a slideshow in iPhoto and put one song with it. I times all the slide durations so that the music would fade out exactly at the end. After exporting to a QuickTime movie, however, the slideshow is finished before the song is... the song is