Question about Querying in SQL Database
-
Hai, I have question about SQL database. I'm using C#2005 let's assume I have a database table 'TEST' with field 'myField' TEST ---------------- Recno | myField ---------------- 1 | axcel 2 | áxcel 3 | axcël 4 | axÇel 5 | áxÇèl ---------------- If I fire the command "SELECT * FROM TEST WHERE TEST.myField LIKE '%axce%'" The query result would be TEST ---------------- Recno | myField ---------------- 1 | axcel ---------------- my Question is : 1. Is there anyway so the query result would contain all of the record instead of first record only?? I assume this has something to do with Localization class in C#. Am I right? 2. If not possible, any suggestion how to make it possible? maybe using Function in SQL Server? I'm barely new to SQL server.. thankz for the information, if this question goes in wrong forum, please forgive me 1st.. regards ~erwin~ Mail me at erwin@holyknight.us
-
Hai, I have question about SQL database. I'm using C#2005 let's assume I have a database table 'TEST' with field 'myField' TEST ---------------- Recno | myField ---------------- 1 | axcel 2 | áxcel 3 | axcël 4 | axÇel 5 | áxÇèl ---------------- If I fire the command "SELECT * FROM TEST WHERE TEST.myField LIKE '%axce%'" The query result would be TEST ---------------- Recno | myField ---------------- 1 | axcel ---------------- my Question is : 1. Is there anyway so the query result would contain all of the record instead of first record only?? I assume this has something to do with Localization class in C#. Am I right? 2. If not possible, any suggestion how to make it possible? maybe using Function in SQL Server? I'm barely new to SQL server.. thankz for the information, if this question goes in wrong forum, please forgive me 1st.. regards ~erwin~ Mail me at erwin@holyknight.us
-
Hai, I have question about SQL database. I'm using C#2005 let's assume I have a database table 'TEST' with field 'myField' TEST ---------------- Recno | myField ---------------- 1 | axcel 2 | áxcel 3 | axcël 4 | axÇel 5 | áxÇèl ---------------- If I fire the command "SELECT * FROM TEST WHERE TEST.myField LIKE '%axce%'" The query result would be TEST ---------------- Recno | myField ---------------- 1 | axcel ---------------- my Question is : 1. Is there anyway so the query result would contain all of the record instead of first record only?? I assume this has something to do with Localization class in C#. Am I right? 2. If not possible, any suggestion how to make it possible? maybe using Function in SQL Server? I'm barely new to SQL server.. thankz for the information, if this question goes in wrong forum, please forgive me 1st.. regards ~erwin~ Mail me at erwin@holyknight.us
wienzzz wrote:
1. Is there anyway so the query result would contain all of the record instead of first record only??
Yes.
wienzzz wrote:
I assume this has something to do with Localization class in C#. Am I right?
No. It is to do with the collation sequence set up in the database. the column is AS (Accent Sensitive)
wienzzz wrote:
2. If not possible, any suggestion how to make it possible? maybe using Function in SQL Server? I'm barely new to SQL server..
When you create the database the collation sequence should be defined as Accent Insensitive (AI). It causes more problems that it is worth to individually define columns as a specific collation.
Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website
-
wienzzz wrote:
1. Is there anyway so the query result would contain all of the record instead of first record only??
Yes.
wienzzz wrote:
I assume this has something to do with Localization class in C#. Am I right?
No. It is to do with the collation sequence set up in the database. the column is AS (Accent Sensitive)
wienzzz wrote:
2. If not possible, any suggestion how to make it possible? maybe using Function in SQL Server? I'm barely new to SQL server..
When you create the database the collation sequence should be defined as Accent Insensitive (AI). It causes more problems that it is worth to individually define columns as a specific collation.
Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website
further question,
When you create the database the collation sequence should be defined as Accent Insensitive (AI). It causes more problems that it is worth to individually define columns as a specific collation
can I just modify the properties after the database created? I try to look for those properties and I couldn't find any properties related to that. Or should it be the SQL Server properties? (like in VFP to turn safety on or something like that?) second, let's assume that I couldn't change it (because I worked on existing database which I'm not able to change the structure), can I called a function to show the field in the view definition? well, maybe here's simple example (I'm not doing it yet) SELECT test.myField, myFunct(test.myField) as newfield FROM test assume that myFunct is the function to convert all the accented character to normal character. can it be the solution? CMIIW thankz for the information regards ~erwin~
Mail me at erwin@holyknight.us
-
further question,
When you create the database the collation sequence should be defined as Accent Insensitive (AI). It causes more problems that it is worth to individually define columns as a specific collation
can I just modify the properties after the database created? I try to look for those properties and I couldn't find any properties related to that. Or should it be the SQL Server properties? (like in VFP to turn safety on or something like that?) second, let's assume that I couldn't change it (because I worked on existing database which I'm not able to change the structure), can I called a function to show the field in the view definition? well, maybe here's simple example (I'm not doing it yet) SELECT test.myField, myFunct(test.myField) as newfield FROM test assume that myFunct is the function to convert all the accented character to normal character. can it be the solution? CMIIW thankz for the information regards ~erwin~
Mail me at erwin@holyknight.us
wienzzz wrote:
can I just modify the properties after the database created?
You can modify each individual column. But it is best that it is done at database creation time - or server install time - because it can get in a complete mess if collation sequences are mixed between various columns.
Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website