x

what is the use of padindex function

what is the use of padindex function , when and where can be used ?
more ▼

asked Nov 21, 2011 at 11:08 PM in Default

jhunu gravatar image

jhunu
90 29 30 31

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first
Returns the starting position of the first occurrence of a pattern in a specified expression, or zeros if the pattern is not found, on all valid text and character data types. syntax : PATINDEX ( '%pattern%' , expression )
more ▼

answered Nov 21, 2011 at 11:18 PM

viikiseth gravatar image

viikiseth
51 1

(comments are locked)
10|1200 characters needed characters left

I'm confused.

Do you mean the PATINDEX function, which, as @viikiseth has indicated, is for string pattern matching - see also http://msdn.microsoft.com/en-us/library/ms188395.aspx

Or did you mean PAD INDEX, which you can use to tune index performance - see http://msdn.microsoft.com/en-us/library/ms186872.aspx

I'm guessing, by the way you described it as a function, that you meant the former...
more ▼

answered Nov 25, 2011 at 12:16 PM

ThomasRushton gravatar image

ThomasRushton ♦
33.8k 18 20 44

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x4

asked: Nov 21, 2011 at 11:08 PM

Seen: 506 times

Last Updated: Nov 25, 2011 at 12:12 PM