SQL help string search

Hi,

Is there any easy way to search a column to see if it contains either a dash 
or alpha character ?

Thanks ! 


0
Robbie
9/12/2010 11:46:54 AM
sqlserver.programming 1873 articles. 0 followers. Follow

1 Replies
1320 Views

Similar Articles

[PageSpeed] 56

On Sun, 12 Sep 2010 07:46:54 -0400, Robbie wrote:

>Hi,
>
>Is there any easy way to search a column to see if it contains either a dash 
>or alpha character ?
>
>Thanks ! 
>

Hi Robbie,

SELECT KeyColumn, SearchColumn
FROM   TheTable
WHERE  UPPER(SearchColumn) LIKE '%[A-Z-]%';

If your database uses a case insensitive collation, you can leave out
the UPPER function call.

-- 
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
0
Hugo
9/12/2010 12:22:32 PM
Reply:

Similar Artilces:

HELP
I'm programing with Microsoft Access 2003 an Invoice, so I have 2 Tables Header and Lines both linked by the field InvoiveNumber. On the "Detail" part of the form: First are the data related with the Client and Invoice (InvoiceNr(autonumber), Invoice date, Client Name,....) Second it displays a subform related to lines of the Invoice, that is the Products, price, quantity, value,... At last the Vat tax and the total of the invoice and a button to print the Invoice that is nothing more then a report. Everything works fine BUT, there is always a BUT, the Vat tax and Inv...

SQL Server Error when going offline MS CRM 4.0
Hi We have quite a few problems with the MS CRM 4.0 Offline Client. When our customer tries to go offline he gets always an SQL Server Error. When we execute the diag tool it shows us that something is wrong with the sync. After executing the repair it works fine and we can go offline without any troubles. The strange thing is, that it does not work on the next day. Then we get the same error again. The only solution is to execute the repair.... We are working for quite a long time together with ms support, but unfortunately they couldn't help us so far. We also have installed several ...

SQL database connections and access from multiple clients
How many concurrent connections can SQL Express 2008 support ? I have a situation where 10,000 clients need to access and update SQL Express database. Is it ok that all the clients directly connects to SQL express and update the database ? What issues can come up in the scenario ? OR is it advised that we write a database access layer(component) which takes care of updating the database and all clients access this components for reading or writing ? regards, Thomas Thomas I think there is no limit concurrent connections for SQL Express 2008 We have some applications that han...

First deployment of .net winforms help needed
Hello, I've never had to deploy a .net solution (winforms) before. In the past (with COM) I'd have to register any dlls with regsvr32. Now with .net we don't have to do that but I'm not sure exactly how to deploy a .net solution. If I compiled a visual studio project in .net 3.5 I need to make sure the destination server is running .net 3.5. Then I just use xcopy to copy the exe and dlls into any directory and that's it? What if I wish to put the dlls in a separate directory? how will the exe find it? I'd really appreciate any help or links on how to dep...

Searching Multiple Timesheets for a project code and then....
I need some help on this one!! I am trying to scan multiple timesheets in excel for a project code and then capturing the hours worked for that project. I then need to have the hours worked summed on a different work sheet to track hours worked for multiple disciplines on one engineering project. (See below for example) Example: Timesheet 1: Monday Tueday Wednesday Thursday Friday Project 'A' 4 2 8 0.5 0 Project 'B' ...

How do you export a Visio Database Model into a new SQL DB?
I have created a Database Model with several tables, columns, etc and I want to export this into a new Database in SQL Server 2005. I do not see any way to do this in the menus. I can see how to reverse engineer and pull stuff from SQL but not pushing into SQL. Hi Todd, The update/refresh model functionality is shipped with the enterprise version of Visio which is included in the Visual Studio .Net package See http://office.microsoft.com/en-us/assistance/HA011496961033.aspx Ren´┐Ż "Todd" <Todd@discussions.microsoft.com> wrote in message news:40B3E364-BF07-4DB7-AA4F-6203D...

help moving to new exchange server
Hi i have hopefully a quick and easy question. we are in the process of migrating our exchange 5.5 server, to exchange 2003. what i need as a quick easy way to modify everyones outlook profile to point to the new server. the new server is in a whole new org, and with a new name. we are using outlook 98,2000,xp, and 2003 i'm leaning towards using the .prf files, but what i am hoping is that someone else has done this and has some scripts already made :) Thanks for any help anyone can give. Where do you get stuck with creating a prf-file? A better way to do it is by using the foll...

please help with this issue
I have a workbook with approx. 25-30 worksheets in it with the last being an overview of the others. I use this workbook to track some basketball stats. What I need to do is to: countif cell A9 of sheet 1 thru sheet 30 are populated with a text letter (P for played), the resultant of the countif will be used to divide into an overall sum of points - thus giving an average points per game. Any suggestions Thanks Dudley Hi Dudley if you list the names of your sheets in an area of the summary worksheet (e.g. A1:A30) you can use the following formula =SUMPRODUCT(COUNTIF(INDIRECT("'...

Public Folders missing after going from Exchange 5.5 to Exchange 2003!!! HELP!
Ok - this is what happened. I was following along in MS KB #316886, and I was on page 5 where it talks about the migration of Public Folders and Mailboxes. What I did was (I didn't read the directions carefully, I know) I went to move the Public Folders to the new 2003 Exchange server. I went to the 5.5 Admin program, and went to the Public Folder that I wanted to move, and I went to Properties, and the Replicas Tab. I misunderstood the directions. So basically, how it was set up was: BEFORE: Servers: Replicate Folders To: EXCH3 EXCHANG EXCH2K3 AFTER: Servers: ...

multiple sheets, need help please
I have a multiple sheet workbook. I want one cell on my second sheet to show either one cell or the other, depending on what is selected, from my first sheet. How can I do this? Thank you. Where you want that result to appear, create a formula using the IF function. The equation will be something like =if(a1=1,Sheet1!b4,Sheet1!c5). The first argument (up to the first comma) is the condition, a logical test. If it's true, then the result of the second argument will be the function's result; otherwise the third argument will be the result. The easiest way to enter the cell re...

Using dates for x-axis values as string instead of creating a scale #2
I figured it out myself. Under "Chart Options" on the Axis tab under the "Category (X) Axis" you mark "Category". Sorry to bother the forum! cs_weirdo Wrote: > I am creating a line graph where I want to identify each point on the > graph by a date (i.e. the source of the x-axis is to a column full of > dates). When I do this, excel puts the dates on a scale, so a lot of my > data is bunched up in the center of the graph. > > Is there any way to format the dates as text for use in the graph > without the text version of the dates being the...

After migrating from Exchange 5.5 to Exchange 2003 I get a connect problem -- Please Help!!
Sometimes a user tries to connect to the Exchange Server from Outlook a window pops up stating that exchange is in recovery mode and gives you a choice to to connect, wait, exit (something close to that). I would have thought that the recovery part by now would be complete but 2 months later still doing the same thing Thank You Will There is a name resolution problem on your network. Make sure that DNS suffix on server and clients do match, and DNS server can be contacted by user's machines. MS Newbie wrote: > Sometimes a user tries to connect to the Exchange Server from Outloo...

formatting a spreadsheet help
I have a few different dilemas going on here. First: Can a conditional format be set up in Vista or Windows 7 both 64 bit, and saved in 97-2003 excel saving the conditional formats? Second: I have a spreadsheet column A is my received date, Column B is Stock #, Column C is Serial #, Column G is my finished date. What I need to be able to do: When I enter information into Column C (Serial #), I need some type of notification if that same number has been entered within a six month time period from my Column G (Finished date). 1. Yes. However, there are some formats which only Ex...

help: how protect formulas in workbook?
Can we locked cells with formulas from editing in one step? When I select cells with formulas in all worksheets by selecting all worksheets and give properties "locked" in Format -Cells-Protection tab and when I try to protect worksheet by Tools-Protection-Protect Sheet is not available. Can we protect all worksheet in workbook in one step or we must do it sheet by sheet? Thanks. spanic -- spanic ------------------------------------------------------------------------ spanic's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=5105 View this thread: ht...

HELP! Need to save in Excel 2.1 format
Hi I have excel 2007, and the datasystem here only accepts excel 2.1 format files. How can i convert or save in excel 2.1 format? I'd really appreciate any input, even link to some external convert program. Thanks Hi, Why you don't try to save it as excel 5.0 It should work when saving as scroll almost to the bottom there you will find excel 5.0 "Poppe" wrote: > Hi > > I have excel 2007, and the datasystem here only accepts excel 2.1 format > files. > > How can i convert or save in excel 2.1 format? > > I'd really appreciate any input,...

Analysis Cubes & SQL 2005
Does anyone know when they are planning on releasing the Analysis Cubes that will work with 2005. We are on Dynamics GP but would like to start using this for our BI reports. Robert ------=_NextPart_0001_195105B9 Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi Robert, My name is Greg and I will be assisting you with Analysis Cubes. Analysis Cubes will be compatible with SQL 2005 in calendar Q3. Please let me know if you have any questions. Best Regards, Greg Byer Microsoft Online Partner Support ====================================================== PLEASE ...

help on reminders
i have a table named tblProduct and then there is a field MaturityDate.. what i want to happen is that every time the product reaches its maturity date, a pop-up form or some sort of reminder wuold appear everytime the database is opened.. please...any help would be much appreciated ... thank you in advance -- ai® Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200711/1 Check out: http://www.utteraccess.com/forums/showthreaded.php?Cat=&Number=1404836&page=&view=&sb=5&o=&vc=1 ai_enjoi wrote: >i have a table n...

Check box help in Word 2007
I have inserted check boxes into a document using the Check Box form field. The user has to go through the document, checking the boxes that apply in a particular client's situation, so it's different every time. I cannot lock the document because it is set up for a merge. Other than having to double click on the check box, then click checked, then click OK (phew!), is there a shortcut, a faster way to do check/uncheck these boxes? I seem to remember (perhaps it was an older version) that a simple double click used to check or uncheck the box. Which makes a lot more ...

For Each Next help
Here is my code. Dim C As Range For Each C In Range("TotalsCells").Resize(1, 0) -----IT FAILS AT THIS LINE Cells.FormulaR1C1 = "SUM(R2C:R[-1]C)" Next C I have a couple of questions. Is my variable declaration correct? I want to inspect each cell in the range. Is my Resize syntax correct for inspecting each cell? Is my Sum syntax correct? Thanks in advance for your help. On Wed, 8 Oct 2008 10:06:18 -0700 (PDT), troy_lee@comcast.net wrote: >Here is my code. > >Dim C As Range > For Each C In Range("TotalsCells"...

Replace Text Based on Variable Search
I have a db that has some older records that contain SSNs in the text. I can serch the record, to find the records needing to be updated, but I don't know how to write the Replace function. My search string is: Like "*#########*" or Like "*###-##-####*" Could someone help me with the code to update based on this criteria? Thanks. Sharkbyte On Fri, 5 Mar 2010 11:17:02 -0800, Sharkbyte <sharkbyte1@hotmail.com-> wrote: >I have a db that has some older records that contain SSNs in the text. I can >serch the record, to find the records n...

SQL Server 2000 Disable Ad-Hoc Access
We recently had an audit done and they came back from some ESM tool and said that this should be disabled. Here are my questions: 1. Why? Does anyone know? 2. The only thing I could find that this is in reference too is when using Linked Servers. We don't use any linked servers on this box. Is there any other time this would come into play? 3. I assume if the linked servers is the only time, then basically it is saying I just couldn't open query analyzer and execute a query against the linked server, it would have to come from a compiled stored procedure. Is that ...

Help me identify the symbols in "Icon" field of my Inbox in Outloo
How does one manage such a query in the simplistic "Help" offered by these people? Where can I find the answer to my question? "Icon" in the search and help facility treat it only as icon the symbol in Windows, not as a specific header in my Inbox in Outlook 2003, the Email program of Microsoft Office. How does one manage a post in which the user failed even to post a question? You force us to guess what it is. That wastes our time and yours. My guess as to what your question is would have this answer: http://www.howto-outlook.com/howto/icons.htm -- Russ Valentine [...

HELP - Organization Unit Disappeared
We had an organizational unit disappear - if I do a 'find' the users are still 'out there somewhere and can adjust their properties, but the OU is gone 1) - if I recreate the OU - where are these users to get them back in? You may want to ask this question in AD group. CL wrote: > We had an organizational unit disappear - if I do a 'find' the users are > still 'out there somewhere and can adjust their properties, but the OU is > gone > > 1) - if I recreate the OU - where are these users to get them back in? > > ...

Please, please help with this
Here's the scenario: I have a text box that has 2 lines of information. The first line has a font color of red The second line has a font color of black At the end of the first line is a paragraph return. Here's an example Jane Doe (this is red font) Newest Member (this is black font) OK, I want to copy Sally Sue onto the line witih Jane Doe, so I highlight the name Jane Doe and choose paste. The problem is, when Sally Sue is included it becomes BLACK (the font color of the second row) and doesn't stay RED (the font color of the previous item). How can I tell the system N...

SQL Server 2000 Report Pack for Microsoft CRM
Dear All, I am a little bit confused; MS released (some time ago) the SQL Server 2000 Report Pack for Microsoft CRM. I think this reporting pack queries directly on the CRM SQL database. But MS always states that querying the CRM SQL database is neither adviced nor supported! So use SQL Server 2000 Report Pack for Microsoft CRM or not? Regards, Marcel van den Aker You can make selects directly from the CRM database. Doing updates or inserts is a whole different story. The CRM webservice interface makes things a lot easier. With SQL Server reporting you can have some other difficultie...