Söka i början och slutet på SQL-strängar

Konstigt att jag under 10 år med SQL inte har behövt göra detta sökmönster. Hittade svaret på bytes.com:

startswith: WHERE x LIKE @Value + '%'

endswith: WHERE x LIKE '%' + @Value

contains: WHERE x LIKE '%' + @Value + '%'

Bakgrunden var att jag migrerade en sajt till nytt webbhotell. På detta fungerade det inte att ha filnamn på bilder som börjar på en punkt.

I mitt fall började alla mina bilder med punkt följd av ett underscore så jag kunde få fram alla med shjälp av följande sökning.

Har filnamnen i en db-tabell och fick fram dem med följande sökning:

SELECT [FileName] FROM [MediaItem] WHERE [FileName] LIKE  '._%'

Och sen bytte ut namnet på alla dessa så de startar med img istället för punkten.

UPDATE [MediaItem] SET [FileName]=REPLACE([FileName],'._','img_') WHERE [FileName] LIKE  '._%';

Sen för att byta ut namnen på själva filerna så hittade jag ett program som funkade, Bulk Rename Utility. Det verkar vara ett rätt avancerat verktyg och finns säkerligen mer lättanvända. Men funkade för mig.


Comments

Schysst lösning och äntligen lite bloggande ;-)

thanks for your amazing website.thank you. http://www.onlinepromotionuae.ae"> http://www.onlinepromotionuae.ae

cyberdesingn

thanks for sharing a useful information with us...... www.andamandiscover.com"> www.andamandiscover.comlink text

nice post.......... Andaman Tour Packages

I like this post with depth thinking, thanks for sharing this post. "Brother Printer technical support provides help for technical error. Get Brother Printer customer service phone number 0800-098-8590(toll free UK) for quick & best resolution. Dial for brother printer tech support, Brother Printer helpline, brother printer support etc.

Printer has a great importance in professional fronts. What will happen if your HP printer stops working while printing some of your important documents? Well answer for it will be available at Hp Printer Contact Number UK. Just call and correct errors in your printer by your own.

Awesome Post.. Nice Content.. Thank you for sharing..Facing technical issues in installation of the Dell printer, Call us at Dell Printer Support Number UK. Our expert will help you to solve these issues.

Nice post, Thank you for posting.

Acer Computer Help Number UK

Acer Support Number UK

Acer Computer Help Desk Number UK

Acer Contact Number UK

thanks for this awesome web page, i like it

Microsoft Helpline

thanks for this awesome web page, i like it Gmail Helpline

Great info.. your content very helpful.. Thank you for sharing.. We Provide Technical Support for Kaspersky Antivirus more help visit here : Kaspersky Help Number UK Kasersky Contact Number UK kaspersky Support Number UK

thanks for this awesome web page, i like it

Microsoft Customer Support Number

thanks for this awesome web page, i like it

Avast Technical Support Number

thanks for this awesome web page, i like it

microsoft help number

Hii, Thanks for the sharing nice posting with us. i’m really impressed. hp printer helpline

Hii, Thanks for the sharing nice posting with us. i’m really impressed. Epson Printer Helpline UK

Today I learned a lot from your website. thank you. Toshiba tech support number

Today I learned a lot from your website. thank you. Norton support number

this is outstanding and great post! i really like it. thank you so much. kaspersky support

Today I learned a lot from your website. thank you epson helpline

thanks for this awesome web page, i like it, Call@ 0800-098-8569 for Windows Support Number, Windows XP support, Windows 10 Support, Windows 8 help, Windows Phone Support, Windows Tech Support, Windows 7 Support.

Windows Help Number

very very nice article, thanks for the sharing with us. Avg Support Number

thanks for this awesome web page, i like it, Toshiba Laptop Support

thanks for this awesome web page, i like it, Call@ 0800-098-8569 for Windows Support Number, Windows XP support, Windows 10 Support, Windows 8 help, Windows Phone Support, Windows Tech Support, Windows 7 Support.

Windows Help Number

this post is extremely good so keep posting further thank you so much.

Call@ 0800-098-8613 for any issue related to yahoo help, yahoo change password, yahoo problems yahoo support, yahoo email settings, etc.

this is outstanding and great post! i really like it. thank you so much. Call +44 (0) 800-098-8613 Help and Support for the outlook, outlook Support Number UK, Outlook Customer Care Number.

thanks for this awesome web page, i like it Epson printer helpline number

thanks for this awesome web page, i like it Epson printer helpline number

we are offered new latest support for epson printer support number.

it is amazing article which provide to the users so thank you very much and if u want any dell support click on my link...

this is outstanding and great post! i really like it. thank you so much and another support visit here..outlook support, outlook support number

Hii, Thanks for the sharing nice posting with us. i’m really impressed. Call us Our Toll-free 0800-098-8613 UK for any set up a hotmail account, reset hotmail password, , Hotmail Support Number, Hotmail Helpline, Hotmail support, click here.. Hotmail Technical Support Number

yes man, its a very useful article. i tried it on my sites. its work. thank you so much Dell Printer Helpline

Hi.. This series is awsum. Such kinds of series are always awsum. You do everything what can make your site more interesting. You know, I always wait for your new updates. I would thank you for entertaining us.

Toshiba tech support

this is outstanding and great post! i really like it. thank you so much. for any kind of support click here.. Hp printer support, hp printer techncial support.

i loved this article and this is so awesome post so thanks to this article.

HP printer driver download, HP printer help

Hi.. This series is awsum. Such kinds of series are always awsum. You do everything what can make your site more interesting. You know, I always wait for your new updates. I would thank you for entertaining us.

Lenovo laptop support

Hi.. This series is awsum. Such kinds of series are always awsum. You do everything what can make your site more interesting. You know, I always wait for your new updates. I would thank you for entertaining us.

Norton support number

Hi.. This series is awsum. Such kinds of series are always awsum. You do everything what can make your site more interesting. You know, I always wait for your new updates. I would thank you for entertaining us.

Toshiba laptop support

Hi.. This series is awsum. Such kinds of series are always awsum. You do everything what can make your site more interesting. You know, I always wait for your new updates. I would thank you for entertaining us.

Lexmark Printer Support

Hii, Thanks for the sharing nice posting with us. i’m really impressed. epson helpline

Today I learned a lot from your website. thank you Acer laptop helpline

What to do when Norton antivirus is not completing the task to protect your system or working slow? The answer is to dial Norton Customer Care Number UK and get the correct resolution to remove the hurdles but the expert technicians. They can resolve every kind tech issues in a short while.

Today I learned a lot from your website. thank you for this article to know about it.

network security software

Hi, Thanks for the sharing nice posting with us. i’m really impressed. Acer Support

It is amazing article that provide to us so thank you very much. fro any types of support visit here...canon printer drivers

Hi.. This series is awsum. Such kinds of series are always awsum. You do everything what can make your site more interesting. You know, I always wait for your new updates. I would thank you for entertaining us.

Toshiba Support Number

Thanks for sharing nice information with us. Canon Printer Support Number UK Canon Printer Helpline Number UK

Take a look at my page.

Hp printer support

Hp printer support number

How to get rid of invalid key error of AVG antivirus? If you want to come out from this query then you can easily take an expert help by one call at AVG contact number UK.

Very Very nice post. its a very useful and outstanding article. Thanks for that.
avast antivirus support number

Its very useful post for me, I like your post and all you share with us is up to date and quite informative. network management system

Thanks for this awesome web page,i’m really impressed.

Hey What a great post. Thank you for sharing. Canon Printer Support Number UK Canon Printer Help Number UK

Want to get exact solution of re-installation issues of Norton antivirus then consult our technical executive at Norton contact Number UK and get the issues resolved as fast as possible.

Thank a lot for this post that was very interesting. Keep posting like those amazing posts, this is really awesome. Bullguard Support Number UK Bullguard Help Number UK

Bullguard Help Number UK

Thank a lot for this post that was very interesting. Keep posting like those amazing posts, this is really awesome. Norton Customer Care Number UK Norton Contact Number UK Norton Phone Number UK

Wow. good post. I’d like to write like this too, taking time and real hard work to make a great article… Call Girls Service Vasant Kunj

This is outstanding and great post! i really like it. thank you so much.

microsoft software support number microsoft customer support

If you are in trouble due to issues coming in your Epson printer driver then you are free to resolve this issue by calling at Epson Printer Support Number UK and get the issues fixed as fast as possible.

Hi, Thanks for the sharing nice posting with us.i’m really impressed.Take a look at my page. printer support number

Wow. what a helpful post. Thank you for sharing. Avast Support Number UK Avast Help Number UK

Such a very useful blog. Very interesting to read this blog. I would like to thank you for the efforts. Brother Printer Support Number UK Brother Printer Help Number UK

Hey!! Awesome post thanks for sharing this...if you want any solution related to Yahoo like (Yahoo Support, Yahoo Customer Service etc) than visit here : link text

Hi I am glad to read your post and I understood it.I know it is very helpful for me and other person. Lenovo Laptop Support Number

Thank you for sharing this post.. Very nice info.. Canon Printer Support Number UK Canon Printer Contact Number UK

Amazing post. Adobe Helpline Number UK

thanks for this awesome web page, i like it Epson Help Number Epson Help desk

https://examkrackers.com/LSAT/Forum/ShowThread.aspx?f=566&t=29345

Nice. Very useful information for readers that you have shared. Keep posting like this. https://www.classifiedads.com/tech_services/1566lxgg61188"> https://www.classifiedads.com/tech_services/1566lxgg61188 Mcafee Antivirus Technical Support

For HP Printers|1-855-234-4888|HP Printer Support

https://www.classifiedads.com/tech_services/15x962nhg1188

Your blog information is nice and friendly. This post is very helpful for me. Thank for post Yahoo Customer Care, Yahoo Help Number

Very nice info.. Avast Support Number UK Avast Contact Number UK

Please fill out all the fields.

*
*