Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 19th, 2009, 08:59 AM
ldoodle ldoodle is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 132 ldoodle User rank is Sergeant Major (2000 - 5000 Reputation Level)ldoodle User rank is Sergeant Major (2000 - 5000 Reputation Level)ldoodle User rank is Sergeant Major (2000 - 5000 Reputation Level)ldoodle User rank is Sergeant Major (2000 - 5000 Reputation Level)ldoodle User rank is Sergeant Major (2000 - 5000 Reputation Level)ldoodle User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Day 8 h 6 m 59 sec
Reputation Power: 34
SQL Server 2005 - Bulk Update

Hiya,

We have a table which contains attachments for related cases. These attachments are stored like this:

Y:\Inprotech_Casedocuments\Patent\E30692GB\2008-1-29-E30692GB-EPT Client Report Filing National Phase.doc
Y:\Inprotech_Casedocuments\Patent\G30692GB\2008-1-29-G30692GB-EPT Client Report Filing National Phase.doc

I need to update all of them (nearly 84000 records!) to remove the first folder and create a folder out of the main folder names first letter. So the above would become:

Y:\Patent\E\E30692GB\2008-1-29-E30692GB-EPT Client Report Filing National Phase.doc
Y:\Patent\G\G30692GB\2008-1-29-G30692GB-EPT Client Report Filing National Phase.doc

Thanks

Reply With Quote
  #2  
Old October 25th, 2009, 06:58 PM
gregory.owen@hp gregory.owen@hp is offline
Maniac
ASP Free Novice (500 - 999 posts)
 
Join Date: Sep 2003
Location: Sweet Home, Oregon
Posts: 598 gregory.owen@hp User rank is Sergeant Major (2000 - 5000 Reputation Level)gregory.owen@hp User rank is Sergeant Major (2000 - 5000 Reputation Level)gregory.owen@hp User rank is Sergeant Major (2000 - 5000 Reputation Level)gregory.owen@hp User rank is Sergeant Major (2000 - 5000 Reputation Level)gregory.owen@hp User rank is Sergeant Major (2000 - 5000 Reputation Level)gregory.owen@hp User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 14 h 46 m 46 sec
Reputation Power: 37
You can sometimes accomplish this with t-sql using a clever update statement, however in this case you may need to use a regular expression. t-sql doesn't provide that, but CLR does. Here's an article.

http://msdn.microsoft.com/en-us/magazine/cc163473.aspx

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > SQL Server 2005 - Bulk Update


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek