Searching for text in SQL Server: CHARINDEX and PATINDEX

SQL Server 101
SQL Server 101
21.4 هزار بار بازدید - 3 سال پیش - In this video, we will
In this video, we will be looking at how to search for text within bigger text searches.
My SQL Server Udemy courses are:
70-461, 70-761 Querying Microsoft SQL Server with T-SQL: https://rebrand.ly/querying-microsoft...
98-364: Database Fundamentals (Microsoft SQL Server): https://rebrand.ly/database-fundamentals
70-462 SQL Server Database Administration (DBA): https://rebrand.ly/sql-server-dba
Microsoft SQL Server Reporting Services (SSRS): https://rebrand.ly/sql-server-ssrs
SQL Server Integration Services (SSIS): https://rebrand.ly/sql-server-ssis
SQL Server Analysis Services (SSAS): https://rebrand.ly/sql-server-ssas-mdx
Microsoft Power Pivot (Excel) and SSAS (Tabular DAX model): https://rebrand.ly/microsoft-powerpiv...
----
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.
3 سال پیش در تاریخ 1400/04/30 منتشر شده است.
21,450 بـار بازدید شده
... بیشتر