|
INTERVIEW QUESTIONS
DATABASE
SQL
DETAILS
Question: Is there any query which is used to find the case sensitivity in each records in database through visual basic?
Answer: For case sensitive string comparison in SQL one has to use substring() and ascii() functions in the following way.
Get first character of both strings using substring function as substring(str1, 1, 1) Find ascii value of both characters and compare. Put statements 1 and 2 in loop to advance to next character For example if (ascii(substring(str1, @pos, 1)) = ascii(substring(str2, @pos, 1)) then @pos = @pos + 1 ....
|
|
|
Category |
SQL Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 6754 users |
Added on |
7/25/2011 |
Views |
71651 |
Rate it! |
|
|
Question:
Is there any query which is used to find the case sensitivity in each records in database through visual basic?
Answer:
For case sensitive string comparison in SQL one has to use substring() and ascii() functions in the following way.
Get first character of both strings using substring function as substring(str1, 1, 1) Find ascii value of both characters and compare. Put statements 1 and 2 in loop to advance to next character For example if (ascii(substring(str1, @pos, 1)) = ascii(substring(str2, @pos, 1)) then @pos = @pos + 1 .... Source: CoolInterview.com
select * from test(table name) where name(field name) = 'MUTHU' COLLATE SQL_Latin1_General_CP1_CS_AS Source: CoolInterview.com
Answered by: Muthumari | Date: 1/28/2008
| Contact Muthumari
select * from test(table name) where name(field name) = 'MUTHU' COLLATE SQL_Latin1_General_CP1_CS_AS Source: CoolInterview.com
Answered by: Muthumari | Date: 1/28/2008
| Contact Muthumari
The best solution is to cast the the comparing columns to varbinary and then compare
eg. select username from tbl where Cast(Password as varbinay(25))=Cast(@Password as varbinay(25)) Source: CoolInterview.com
Answered by: Ravi Garg | Date: 2/13/2008
| Contact Ravi Garg
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
I have a table with duplicate names in it. Write me a query which returns only duplicate rows with number of times they are repeated.
|
View Answer
|
|
How to copy sql table.
|
View Answer
|
|
Difference between Store Procedure and Trigger
|
View Answer
|
|
Cursor Syntax brief history
|
View Answer
|
|
Explain normalization with examples.
|
View Answer
|
|
How to find out the database name from SQL*PLUS command prompt?
|
View Answer
|
|
How can we backup the sql files & what is SAP?
|
View Answer
|
|
Whats the back end processes when we type "Select * from Table"?
|
- SQL Interview Questions & Answers">
View Answer
|
|
What is the difference between SQL and SQL Server?
|
View Answer
|
|
What is table space
|
View Answer
|
|
What is diffrence between Co-related sub query and nested sub query??
|
View Answer
|
|
There is a eno & gender in a table. Eno has primary key and gender has a check constraints for the values 'M' and 'F'.
While inserting the data into the table M was misspelled as F and F as M.
What is the update statement to replace F with M and M with F?
|
View Answer
|
|
When we give SELECT * FROM EMP; How does oracle respond:
|
View Answer
|
|
What is reference cursor ?
|
View Answer
|
|
What operators performs pattern matching?
|
View Answer
|
|
There are 2 tables, Employee and Department. There are few records in employee table, for which, the department is not assigned. The output of the query should contain all th employees names and their corresponding departments, if the department is assigned otherwise employee names and null value in the place department name. What is the query?
|
View Answer
|
|
What is difference between Oracle and MS Access? What are disadvantages in Oracle and MS Access? What are features & advantages in Oracle and MS Access?
|
View Answer
|
|
Can we call user defined packages in SQL statements?
|
View Answer
|
|
What is normalization,types with eg's. _ with queries of all types?
|
View Answer
|
|
Difference between a equijoin and a union
|
View Answer
|