Performing A Whitespace-insensitive Query

Jul 20, 2005

Hi,

I am trying to concoct a query that will join rows on the basis of a
whitespace insensitive comparison. For instance if one row has the value
'a<space>b' and another has the value 'a<space><space>b' I want them to be
considered equal (but not the same as 'ab')

I am happy to do some T-SQL if that helps. Also I have a full-text index on
the column in question, but note that I am comparing rows against each
other, not to a fixed string.

This is for a one-off job, so if there is no obvious way to do it on the
database, I will just bcp out the data and knock up some perl or something
to do it. All other things being equal I would rather do it on the database
though.

Many thanks

Andy

View 11 Replies


ADVERTISEMENT

Accent Insensitive Sql Query

Aug 29, 2000

I'm having a problem with a SQL Query.

I have a table with names and some of the first names
have accents. e.g. Jose. Now Jose has a access over the
"e" in the database. How can I perform an access insentitive
query to the database so if I type "Jose" without the accent over
the "e" would return "Jose" with the accent over the "e".

Thanks in advance.

- teddy

View 2 Replies View Related

Performing A Hierarchical Query...

Mar 26, 2008

Hi. I'm trying to find out which "cases" have a new items added to our database. I have provided a sample layout.

ID ParentID Name CreateDate
358 2 SMITH, JOHN 3/3/2008 11:15:23 am
359 358 Invoice 3/5/2008 4:13:52 pm
360 358 Shipping 3/5/2008 5:11:09 pm
361 358 Receiving 3/6/2008 4:22:01 am

The main ID for this is 358. The invoice, shipping, and receiving items are child items. I would like to run a query that can report which cases have newly added items. This is hierarchical I guess and I'm quite lost. I hope this makes sense. Thanks for any help!

View 3 Replies View Related

Performing A Query Using Two Tables

Jul 20, 2005

Hi,Have a database that contains various tables.I need to run a query on two tables.Table A contains a column called TitlesTable B contains a column called Uni_TitlesIn Table B's column it contains multiple titles as shown belowseparated by semi-colons in each row.Table B Uni-Title Column__________________________Row 1: Landlord and tenant; Leases; Rent reviewsRow 2: Acquisitions; Advisers; Appointment; Contract termTable A - Titles Column_________________________Table A's column contains a only one of the words in Table B's columni.e. Landlord and tenantI would like to obtain a count of how many times the same word orphrases appears in the column of Table B.ThanksSteve

View 2 Replies View Related

Performing Insert Query With Check

Feb 29, 2008

hii,,i am using asp.net 2005 and sql server 2005.i have a web page in which i can enter details and it gets stored in a table in a database..in the table thrs a column called as sme_id,,what i want is when one inserts a new sme_id from the page,,it should check in the table so tht no duplicate sme_id wil b generated..,,this code is workin fine,,i just want to implement the above condition...here is the insert code which i have used along with sql datasource:::__________________________
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"
ConnectionString="<%$ ConnectionStrings:sme_trackerConnectionString %>"
InsertCommand="INSERT INTO SME_Master(SME_Id, FirstName, LastName, Type_of_SME, Agency_id, Agency_Name, Email, Address, Phone, Mobile, Fax, TimeZone_Id, Experience, City, State, Status, Level_Of_Exam, Other_Comments, Certificate, Expertise)
 VALUES (@SME_Id, @FirstName, @LastName, @Type_of_SME, @Agency_id, @Agency_Name, @Email, @Address, @Phone, @Mobile, @Fax, @TimeZone_Id, @Experience, @City, @State, @Status, @Level_Of_Exam, @Other_Comments, @Certificate, @Expertise)"
OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [SME_Master]">
_______hope u got my problem,,,,,reply asap....thnks in advance

View 11 Replies View Related

Query On Performing Recursive Joins

Apr 14, 2007

I have a single table named PROCESS which contain following three fields

ProcessID
ParentID,
info

* Every process have a unique ProcessID and ave single parent process which is identified by ParentID.

* If a process does not have a Parent then its ParentID value is -1.

*Only single level of Parent-child hierarchy is maintained.


Can anyone please tell me the Query that uses Recursive JOINS to retrieve the ProcessID s based in following Conditions.

1. if the Parent's 'info' field contains given value then retrieve all the process under it.
2. Retrive all the process whose 'info' contains given value and excluding the Processes resulted from 1st conditiion

Thanks in advance

Bharath Booshan L

View 2 Replies View Related

Problem Performing A Join On A Function In A SQL Query

Sep 6, 2006

Hello,

Can someone explain why this code contains the following error:


Msg 4104, Level 16, State 1, Line 2

The multi-part identifier "TheTable.StartValue" could not be bound.



CREATE FUNCTION MyFunction(@StartValue int)

RETURNS @MyTable TABLE

(

NextValue int NOT NULL

)

AS

BEGIN

INSERT INTO @MyTable(NextValue)

VALUES (@StartValue + 1)

INSERT INTO @MyTable(NextValue)

VALUES (@StartValue + 2)

RETURN

END

GO

CREATE TABLE TheTable

(

StartValue int NOT NULL

)

GO

INSERT INTO TheTable(StartValue)

VALUES (10)

INSERT INTO TheTable(StartValue)

VALUES (20)

GO

SELECT *

FROM TheTable CROSS JOIN

MyFunction(TheTable.StartValue)

View 6 Replies View Related

DB Engine :: Linked Server - Getting Error When Performing Cross Instance Query With Joins

Apr 26, 2015

I've successfully created a Linked Server that connects a local DB Engine with another DB Engine through an ip over an extranet. I am able to run simple Select statement queries on the Local DB Engine and get results from the linked server. However when attempting to perform more complex queries that join tables from the linked server with tables from the local DB server, I get the following error message after several minutes of execution:

OLE DB provider "SQLNCLI11" for linked server "<ip of Linked Server>" returned message "Protocol error in TDS stream".
OLE DB provider "SQLNCLI11" for linked server "<ip of Linked Server>" returned message "Communication link failure".

Msg -1, Level 16, State 1, Line 0

Session Provider: Physical connection is not usable [xFFFFFFFF].

OLE DB provider "SQLNCLI11" for linked server "<ip of Linked Server>" returned message "Communication link failure".

Msg -1, Level 16, State 1, Line 0

Session Provider: Physical connection is not usable [xFFFFFFFF].

OLE DB provider "SQLNCLI11" for linked server "<ip of Linked Server>" returned message "Communication link failure".

Msg 10054, Level 16, State 1, Line 0

TCP Provider: An existing connection was forcibly closed by the remote host.

How I can resolve it. I've read on Distributed Transactions but I understand that it only applies to manipulation statements?

Both are SQL servers. Linked Server is SQL2008R2 if not mistaken. Local DB Engine is SQL2014.

View 3 Replies View Related

Doing A Case-sensitive Query In A Case-insensitive Database

May 29, 2008

I am working in a SQL server database that is configured to be case-insensetive but I would like to override that for a specific query. How can I make my query case-sensitive with respect to comparison operations?

Jacob

View 5 Replies View Related

How Can I Hide Whitespace

Mar 28, 2008



I am currently working on a rather simple report, it cosists of a table with two columns
The first column contains Employee Names, and the second column contials details of what the have worked on
I have made the second column invisible, and can be made visible when the eployee name column is expanded.
The problem that i am having is that when the second column is collapesed, it still leaves whitespace, in the first column, of how ever many rows that are contained in the second column, is there a way, I can get rid of that whitespace?

Thanks
Chris

View 4 Replies View Related

Whitespace In A Table

Jan 16, 2007

Hello All,

I am having a problem with whitespace showing up within a table. I have a grouping by date that toggles the fields correctly but when the fields are not expanded, the space where the data would be is showing as whitespace instead of collapsing up. Can anyone shed some light on how to make the whitespace go away?

Thanks

Clint

View 4 Replies View Related

Weird Margin WhiteSpace

Oct 8, 2007

I am hoping there is an easy way to fix this. I have a report defined 8.5" x 11.0" with .5" Margin's all around. I am using the WinForms Report Viewer Control (doing Server side reports). It looks like the viewer is taking the left margin and adding it to the right margin. So you get large amounts of white space on the right of the viewer. This requires me to make the viewer way larger than it needs to be to get rid of the ugly Horizontal Scroll bar.



What I want is either don't show the margins until you print (removing the margins from the RDLC file does nothing), or have the left margin white space belong on the left side.



Why is this happening? And how can I fix it? Thanks!

View 1 Replies View Related

Dynamic Layout &&amp; Whitespace

Dec 19, 2006

Hi,

I have a report that, among other things, contains 3 tables laid out side-by-side horizontally. The first table is conditionally visible and when it is hidden the report contains whitespace instead of the table. The problem is that this causes an unappealing visual look because the other 2 tables look shifted too much to the right.

What is the recommended way for dealing with situations like this? There doesn't seem to be support for specifying the location (i.e. top, left) of elements based on expressions. Am I "stuck" with having to create multiple flavors of the report?

Thanks,

Vitaly

View 2 Replies View Related

DT_Str And Trailing Whitespace?

Apr 26, 2007

I have a OLE DB Source going to a flat file destination. My source is a sql variable with "select * from tablename" which have varchar datatypes. Yet I'm getting trailing spaces at the end of some of my columns (for instance, my address column).

I've checked the data by doing a "select Max(Len(address)) from tablename" and the max is only like 34 chars, yet each of them have 100 chars total.

Taking a look at my flat file connection, the outputColumnWidth is 100, and datatype is string [DT_STR]. Am I crazy? What's the problem here? Is the DT_STR datatype the equivalent of char, and not varchar?

Any help, of course, will be appreciated.

View 8 Replies View Related

Whitespace In Textboxes. How Do I Insert A Tab?

Feb 6, 2007

So...I'm trying to insert a tab (or just a few spaces) at the beginning of a line in a textbox. Is this possible? If so, what do i have to do?

View 1 Replies View Related

Finding Last Whitespace Character In A String?

Jul 23, 2005

I'm trying to figure out how to find the last whitespace character in avarchar string. To complicate things, it's not just spaces that I'mlooking for, but certain ascii characters (otherwise, obviously, justuse LEN). My initial thought was to REVERSE it, find the location(using CHARINDEX) looking for each of those characters (so, multiplequeries), then subtract that from the LEN of the string.The problem I'm running into is that there are about a dozen differentcharacters we're looking for. Any suggestions? My thought was to(this sounds silly, so there's gotta be a better way) dump the resultsfrom each CHARINDEX into a table, then find the MAX of the table anduse that. But, like I said, it sounds silly. I don't think I can do a[^0-9A-Z] either, since there are non-Alphanumeric characters we'relooking for.Many thanks.

View 10 Replies View Related

Best Way To Force A Varchar Column To Have No Whitespace

Oct 2, 2006

I have a column that I do not want any whitespace in whatsoever. I'mwondering how do enforce this a DDL level instead of in 40 millionseat-of-the-pants after-the-fact computer programs accessing thedatabase.Regards,Terrence

View 5 Replies View Related

Problem With Full-Text Search And Whitespace

Jan 11, 2008

I am having an problem with using full-text search and phrases in ASP.NET 2.0 when populating a treeview.
 
 
I have a stored procedure that searches a full text index and brings back the results in a datareader.  It fails when I try to search for more than one word with a space in between.
I get the error SQLException was unhandled by usercode "Syntax error near 'up'' in the full-text search condition ''item up''." 
The stored proc is as follows:
CREATE PROCEDURE [dbo].[SearchResults] @criteria as varchar(50)
 
AS
BEGIN
SELECT *
FROM PMGNT_PROJECTS PRJCT INNER JOINCONTAINSTABLE(PMGNT_PROJECTS,*,@criteria) K
ON PRJCT.PRJCT_REFNO = K.[KEY]
END
 
The stored procedure works fine though query analyser it's only when I try to use it in ASP.NET and use more than one word that it fails e.g. "item up". Search for single words also works fine in ASP.NET
 Code is as follows:
  1 if (SearchField.Text != "")
2
3 {
4
5 string searchString = "";
6
7 searchString = "'" + SearchField.Text + "'";
8
9
10
11 SqlConnection SqlCon = new SqlConnection(ConfigurationManager.ConnectionStrings["DBConnectionString"].ConnectionString);
12
13 SqlCon.Open();
14
15 SqlCommand SqlCmd = new SqlCommand("SearchResults", SqlCon);
16
17
18 SqlCmd.CommandType = CommandType.StoredProcedure;
19
20 SqlCmd.Parameters.Add("@criteria", SqlDbType.VarChar);
21
22 SqlCmd.Parameters["@criteria"].Value = searchString;
23
24
25
26 SqlDataReader Sdr = SqlCmd.ExecuteReader();
27
28 SqlCmd.Dispose();
29
30 string[,] ParentNode = new string[200, 2];
31
32 int count = 0;
33
34 while (Sdr.Read())
35
36 {
37
38 ParentNode[count, 0] = Sdr.GetValue(Sdr.GetOrdinal("PRJCT_REFNO")).ToString();
39
40 ParentNode[count++, 1] = Sdr.GetValue(Sdr.GetOrdinal("PRJCT_CODE")).ToString();
41
42 }
43
44 Sdr.Close();
45
46 for (int loop = 0; loop < count; loop++)
47
48 {
49
50 TreeNode root = new TreeNode();
51
52 root.Text = ParentNode[loop, 1];
53
54 root.Value = ParentNode[loop, 0];
55
56 root.SelectAction = TreeNodeSelectAction.Select;
57
58 SqlCommand Module_SqlCmd = new SqlCommand("SELECT * FROM PMGNT_MILESTONES MILST where MILST_PRJCT_REFNO =" + ParentNode[loop, 0], SqlCon);
59
60 SqlDataReader Module_Sdr = Module_SqlCmd.ExecuteReader();
61
62 string[,] ChildNode = new string[200, 2];
63
64 int countChild = 0;
65
66
67
68 while (Module_Sdr.Read())
69
70 {
71
72 ChildNode[countChild, 0] = Module_Sdr.GetValue(Module_Sdr.GetOrdinal("MILST_REFNO")).ToString();
73
74 ChildNode[countChild++, 1] = Module_Sdr.GetValue(Module_Sdr.GetOrdinal("MILST_TITLE")).ToString();
75
76 }
77
78 Module_Sdr.Close();
79
80 for (int cloop = 0; cloop < countChild; cloop++)
81
82 {
83
84 TreeNode child = new TreeNode();
85
86 child.Text = ChildNode[cloop, 1];
87
88
89
90 root.ChildNodes.Add(child);
91
92 }
93
94
95
96 // Add root node to TreeView
97
98 SearchResultTree.Nodes.Add(root);
99
100 }
101
102 SearchResultTree.CollapseAll();
103
104 SqlCon.Close();
105
106
107 }
108
109

 
 Can anyone Help ?

View 9 Replies View Related

Hidden Graph At Top Of Report Causes Unwanted Whitespace

Mar 31, 2008



Hi,

I have a need to create a report that has a graph at the top and a table at the bottom. The graph at the top can optionally be made hidden because they cause problems when exported to Excel as images. However, when I set the Hidden property of the graph to true, positions of all items on the report remain absolute. Meaning of course that the table that is located half-way down the page remains half-way down the page and there is a lot of nothing on the first half where the graph used to be.

It would be desirable to have the ability to have the table move up when the graph is not visible, however it obviously doesn't do it automatically and also refuses me the ability to change the position with an expression.

Any advice is appreciated, thank you!

View 3 Replies View Related

INSENSITIVE CURSOR

Jul 16, 2006

  Hi,
 
  DECLARE MyCursor CURSOR READ_ONLY FOR Select statement
 
  it seems I could not use INSENSITIVE in this cursor declaration, how can I accomplish that?
 
 

View 1 Replies View Related

Case Insensitive

Aug 29, 2000

Is it possible to change this option once SQL Server has been installed or is it only available to be set when installing ?

thanks

View 1 Replies View Related

Case Insensitive

Nov 21, 2006

Sqlserver is case insensitive in this way ?for example:select....where col1 like '%BURG%'will return 'Burger King' ???!!!

View 9 Replies View Related

CURSOR INSENSITIVE

Jul 16, 2006

Hi,

DECLARE MyCursor CURSOR READ_ONLY FOR Select statement

it seems I could not use INSENSITIVE in this cursor declaration, how can I accomplish that?

View 6 Replies View Related

Help Needed! Need To Force Leading Whitespace Characters On SQL Import! =

Feb 3, 2006

I know that this almost never happens... but Im dealing with an AIX flatfile-database conversion that brings 80 tables into SQL.  Im not allowed to touch this stuff or to massage how its brought over to SQL, as it deals with medical records...
What I need to do though, is on creating my own table imports, for my "account" fields to match with the existing SQL conversion table "account" fields, I have to match requirements...
Existing account numbers are a total of 6 charaters.  Account numbers with less than six characters contain leading whitespace character equivalents to total the six character spaces for "account number"
When I import records, I need to force the same requirement and have a min and max length of characters for "account number" = 6 characters and any account number less than 6 characters must also have the necessary whitespace character equivalent added to it.
How would I do this?  It needs to be automated, as this is a process that will run nightly and cannot have a human sitting on it every day, 7 days a week... I cannot accurately join unless I can meet this requirement and my hands are tied because I can't change the way the formatting is done on the imported tables =(
Any help would be greatly appreciated... I'm quite stuck
 

View 5 Replies View Related

DtExec: Setting User-defined Properties With Whitespace?

May 2, 2007

Hi there.



I'd like to call dtexec with something like this:



dtexec /f myPackage.dtsx /Set package.variables[User::connStr].Value;Source=localhost;Provider=blah;Integrated Security=SSPI;



I get an error along the lines of

Option "Source=localhost;Provider=blah;Integrated" is not valid".



How do I pass in a property containing spaces? I've tried all of the usual quote-encasing patterns I can think of.



Thanks,



Jon

View 5 Replies View Related

Case Sensitive Vs Insensitive

Jul 2, 2004

After all the pain I've been going through with code pages and collation, I was asked how, when sql server does it's joins and predicate searches, how does it actual (internals now) know the an "A" = "a" in an insensitive search?

I didn't have the answer.

Damn, Now I really have to pick up Kelans book.

View 14 Replies View Related

Case Insensitive Lookups?

Feb 2, 2006

Is there an easy way to get the Lookup component to ignore case?

View 1 Replies View Related

Set MS SQL 2000 Case-insensitive

Nov 22, 2006

set MS SQL 2000 case-insensitive

View 1 Replies View Related

Reporting Services :: SSRS Tablix Column Toggle Whitespace

Oct 14, 2015

I am facing whitespace issue in my SSRS report. I have simple tablix report with 10 columns. I am trying to toggle column 5 to 8 using on column 4. The problem I am facing is the whitespace. Now column 5 to 8 are only visible when we expand column 4. When the report is rendered on the screen, there is a huge gap between column 4 and 9.

View 4 Replies View Related

Case-insensitive Unique Constraint?

May 19, 2007

I have a table in MSSQL 2005 Express that stores user data. I would like to maintain the cases of user names, but I need to insure that they are not duplicated using different cases. Is there a way that I can create a constraint to enforce this?

Thanks,
WBuik

View 4 Replies View Related

Case-insensitive Search Of Varchar(max)

May 12, 2008

We have an in-house set of databases created by a member of staff who left the organisation in circumstances that mean he will not respond to queries relating to his work here. The programs he produced whilst in our employ are compiled and we have no access to the code, or the tools that he used (don't ask).

The programs allow the user to limit views based on various fields, but not the most useful field, a "memo" type field containing a textual description of work requests.

I only have Delphi 7 to use for the program development and have been using ADO, but my problem is I need to perform a case-insensitive search of a varchar(max) column based on text entered by user, but have been unsuccessful using LIKE and UPPER (which it appears you cannot use with a varchar).

Can anyone provide suggestions for what I am sure is a rather mundane and easy task for all of you.

Please note that I have only the Delphi, and no direct access to the SQL management tools.


Many thanks

Rob

View 5 Replies View Related

Making Excel Source Case Insensitive

May 22, 2007

Hi:

When I import data from multiple excel files, the Excel source gives validation errors if the case of a column name changes.

How can I make my excel source Case Insensitive?

TIA

Kar

View 5 Replies View Related

How To Find A Field In Case Insensitive Using GetVirtualInputColumnByName

Jan 22, 2008



Hello Experts,

I tried to retreive an input column using GetVirtualInputColumnByName, to map it with output, it gave error. I found that it is because the value passed bstrName parameter was in different case. say for example in the column it is "ColNo1" where as in the GetVirtualInputColumnByName i used "Colno1".

Can anyone tell, Is there anyway to find the column in a case in-sensitive way?

Thanks.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved