November 20, 2020

Replicate, Space, Patindex, Replace and Stuff string functions in sql server 2008 Part 24



In this video we will learn about commonly string functions in sql server 2008 like Replicate, Space, Patindex, Replace, and Stuff. We will look at some real time examples of where we can use these functions.

Text version of the video

Slides

All SQL Server Text Articles

All SQL Server Slides

All Dot Net and SQL Server Tutorials in English

All Dot Net and SQL Server Tutorials in Arabic

Nguồn: https://belahanajima.com/

Xem thêm bài viết khác: https://belahanajima.com/cong-nghe/

Related Posts

Cách cài lại Windows 7 từ ổ cứng (Không cần USB, đĩa DVD) | Reinstall Windows 7 without USB or DVD

July 1, 2020

July 1, 2020 41

✍ Cách cài lại Windows 7 từ ổ cứng (Không cần USB, đĩa DVD) 2019 | Reinstall Windows 7 without...

How To Reset Identity Column Value in SQL Server Table – SQL Server / TSQL Part 43

June 30, 2020

June 30, 2020 1

SQL Server / TSQL Tutorial Scenario: How To Reset Identity Column Value in SQL Server Table In this video you...

BacBa – Hard Reset Samsung Galaxy J5 Prime

July 5, 2020

July 5, 2020 49

– You can also try Tenorshare 4uKey for Android ( to unlock Pattern or Pin lock on Samsung, Huawei, LG,...

Huawei Y7 Chạy Lại Chương Trình Khi Quên Mật Khẩu Màn Hình

June 29, 2020

June 29, 2020 30

Huawei Y7 Chạy Lại Chương Trình Khi Quên Mật Khẩu Màn Hình *** Lý do tại sao bạn có thể...

Epson l800 Reset

July 2, 2020

July 2, 2020 3

How to reset Epson l800 printer. epson l800 ink level reset. epson l800 check ink level error. epson l800 reset....

Hướng dẫn chi tiết: Cài đặt, cập nhật, fix lỗi cập nhật FPT PLay Box + 2019

July 7, 2020

July 7, 2020

FPT Play Box là Android Box TV, sử dụng cho mọi chiếc TV. Sản phẩm được thiết kế nhỏ gọn...

Git tutorial: Reverting a commit | lynda.com

July 7, 2020

July 7, 2020 3

This Git tutorial shows how undo changes made by a previous commit with the revert command. Watch more at This...

Hướng dẫn cách reset thanh công cụ của Photoshop về mặc định và lưu các cài đặt lại

July 2, 2020

July 2, 2020 16

Hướng dẫn học PHOTOSHOP CC 2018 MỚI Trong quá trình sử dụng Photoshop, có một số bạn “CHUYỂN CÔNG CỤ”...

Samsung Galaxy J7 HARD RESET

June 29, 2020

June 29, 2020 34

You can also try dr.fone – Android Lock Screen Removal to bypass pattern, PIN, password & fingerprints for Android devices...

How to reset identity to 1 in SQL server | Difference b/w Truncate and Delete | Database Sql server

July 4, 2020

July 4, 2020 1

Microsoft SQL Server’s identity column generates sequential values for new records using a seed value. The term seed refers to...

Hướng dẫn reset router wifi tp-link về mặc định sản xuất

July 1, 2020

July 1, 2020 22

Cấu hình Password Wifi và Tên wifi tại đây: ====Hướng dẫn reset router wifi tp-link về mặc định +++ Reset...

hướng dẫn sửa lỗi E7-4 máy giặt toshiba, cách xóa mã lỗi

July 5, 2020

July 5, 2020 41

tuyệt chiêu sửa lỗi E7-4 máy giặt toshiba, xóa mã lỗi e7-4 , cách xac định hư phần cứng ,...

Hướng dẫn cập nhật firmware loa JBL Pulse 2: fix lỗi đèn và mất kết nối

July 5, 2020

July 5, 2020 9

Hướng dẫn cập nhật firmware loa JBL Pulse 2: fix lỗi đèn và mất kết nối ▶ Mua loa JBL...

Windows 7 Reset TCP/IP and Winsock [Tutorial]

June 30, 2020

June 30, 2020 13

Windows 7 Reset TCP/IP and Winsock [Tutorial] Topics addressed in this tutorial: reset tcp/ip reset tcp ip stack Windows 7...

How to Reset Adobe illustrator to Default Settings || reset preferences illustrator cc 2020

June 30, 2020

June 30, 2020 9

Description: Thanks For Visit My Channel. I Hope You Like My Videos This channel is all about to 🔥Run time...

Comments
  • Hi venkat,
    Could you please tell me how to write the below sql statement in Oracle
    Patindex(‘%0-9%’, alphanumeric column)
    How to give range in instr function??

  • Come on Venkat, or someone…if could explain what is happening here… Because without CHARINDEX('@', Email)+1) at the end also return the same result :
    select FirstName, LastName,

    SUBSTRING(Email, 1, 2) + REPLICATE('*',5) + SUBSTRING(Email, CHARINDEX('@', Email), LEN(Email))

    from tblEmployee

  • Venkat for president ❤️… Love your video tutorials bro, wish I could meet you one day, you are an amazing teacher

  • Hello Sir! I really appreciate your hard work simplifying SQL in the best way ever, I admit I never found anyone who can do it in the best way as you do. Thus, I really want to be like you, you're my role model, I am doing my best for the moment, however, I just want to know how much it took you to learn using SQL just as you do now ? A year, two … ? I am actually making sure to learn all of what you provided in here and I am learning fast, does this mean if I ever finished all of your tutorial videos, and eventually will be able to use all of the queries you provided that I am well qualified to use SQL ? I hope you would answer me so soon.
    regards.

  • How can i split this into two columns
    like
    ID and Description
    867 Other infectious and parasitic diseases diagnoses with mcc
    Integer value in Id column and rest will be in Description column]

  • Thanks Venkat for providing such comprehensive tutorial. I have been practicing sql questions online and came across a question to find median of a column. I would love you to do a tutorial on writing a sql for finding the median of a column in a table (for example median salary per department).

  • STUFF is simpler if compared to REPLICATE function inside Substring.
    Sample Code on STUFF with REPLICATE:: SELECT Name,STUFF(Email,2,3,REPLICATE('*',5)) from tblPerson;

  • I don't understand the idea of SPACE-function. I understand how it works, but I don't understand why it exists. SPACE(5) = REPLICATE(' ', 5), right? Why separate function is needed?

  • It's the best video tutorial, even if it is to compare with the courses wich I bought. I'm reading also the book Querying Microsoft SQL Server 2012 Training Kit and I can see the quality of your video's. Thank's for your work.

  • Hi Venkat ,your videcs are awesome and easily understandable,thanks a lot for making it,i got doubt regarding patindex and charindex ……when I am using charindex it is giving me result as you said …I was trying it with patindex too…..where I got the result forselect SUBSTRING(Email,PATINDEX('%@%',Email)+1,LEN(Email)-PATINDEX('%@%',Email))as domain from tblemployee   but when I use in group by it is throwing errorselect SUBSTRING(Email,PATINDEX('%@%',Email)+1,LEN(Email)-PATINDEX('%@%',Email))as domain, count(Email) from tblemployee group by SUBSTRING(Email,PATINDEX('%@%',Email)+1,len(Email)-PATINDEX('@',Email))can u suggest me y?thanks in advance…..

  • Hi Venkant , Your videos are of high quality . Thanks for making it . Could you please make a video of finding first monday of the month

  • Just for Info actual query to replace .com with .net in the table would be
    UPDATE tblEmployee SET Email=REPLACE(Email,'.com','.net')

  • select ID, Name, SUBSTRING(Email,1,2)+REPLICATE('*',2)+SUBSTRING(Email, CHARINDEX('@',Email),LEN(Email)) from tblPerson
    I think len(email) is better because anyways there are no characters after the last .domain name. It saves the trouble of calculating the remaining length but still for other situations we might need the exact remaining length. Nice explaination. Just watching one by one.

  • Mask all characters between the first letter and the @ sign:
    select *, stuff(Email, 2, len(Email) – (len(Email) – charindex('@', Email) + 2),
    replicate('*', len(Email) – (len(Email) – charindex('@', Email) + 2))) as StuffedEmail from tblEmployee

  • Hi, Awsome. we are learing lot of things from right professional
    .
    I have one small doubt on Patindex . i understood that it is used with wild card.

    But,     select * from emailtable where email like '%@aaa.com'

    retrieves the same result.

        select email,PATINDEX('%aaa.com',email) as occurance
        from emailtable where PATINDEX('%aaa.com',email)>0

    these returns same. what is the use of pat index in this situation ?

  • This is free. It it were not free, I would not mind paying $50 or so to take a class from you. I follow a long and I understand it.

  • I enjoyed this video.
    Friends if you want to answer what is the diff bet CHAR and PAT INDEXS in the interview then this is the best video.
    Thanks a bunch

  • Hi, Very soon as soon as I am done with sql server. If you can subscribe to my channel, you will be getting updates when I upload new videos. Thank You.

Leave a Reply

Your email address will not be published. Required fields are marked *