Searching for text in SQL Server: CHARINDEX and PATINDEX

preview_player
Показать описание
In this video, we will be looking at how to search for text within bigger text searches.
My SQL Server Udemy courses are:
----
In this video, I'll show you how to use the SQL Server functions CHARINDEX and PATINDEX to search for text in a table.

These functions are useful if you need to find a specific piece of text in a table. They both have the same syntax, so you can use either one depending on what you need. I'll also show you some examples of how to use these functions to search for text in a table. Thanks for watching!

CHARINDEX - this is the SQL Server equivalent of INSTR or FIND. SQL Server is 1-based, so the first character is character number 1, not 0. You can either start searching from the beginning, or from partway through the string.
PATINDEX - sometimes, looking for string literals is not sufficient. You may need to use wildcards such as % and _ as well. This is when you use PATINDEX. However, you must start searching from the beginning with PATINDEX.
Рекомендации по теме
Комментарии
Автор

In future most will realise how powerful this lesson was and come back to like and comment. Nice one Sir.

emmanuelphiri
Автор

Hello. From 1m40s you talk about how to find the 2nd 'e'. How would we find the third 'e' ?

neilostle
Автор

*muda muda muda muda muda muda muda muda!*

BelegaerTheGreat
Автор

How to enable viewing syntax and command definition [while typing any command] in MS-SQL as we see in Excel

AnshulMarele-gbaa