Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The usage of SQL Server stuff function

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Function

Deletes characters of the specified length and inserts another set of characters at the specified starting point.

2. Grammar

STUFF (character_expression, start, length, character_expression2)

3. Explanation

Character_expression is the string to be processed

Start is the starting position of the deleted character, and the string starts at 1. If you want to delete from the second character, the start is 2.

The length of the character to be deleted by length. If you delete from the second character and delete three characters, the length is 2.

Character_expression2 wants to replace the deleted string (it's a bit of a mouthful, but it's not hard to understand)

4. Examples

If the preprocessed string character_expression is' abcdef', wants to delete 'cde', the stuff function is written as follows:

Stuff ('abcdef',3,3,'')

If you want to replace 'cde' with' xyz', the stuff function is written as

Stuff ('abcdef',3,3,'xyz')

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report