cancel
Showing results for 
Search instead for 
Did you mean: 

SQL update part of an entry

GertjanA
Moderator
Moderator
Partner    VIP    Accredited Certified

Hello all,

Not really related to EV operation.

I am in the proces of preparing for a DR test
The indexes are running on file-servers.

I have to update rows in SQL.

The command I use (amongst others) is as below.

UPDATE [EnterpriseVaultDirectory].[dbo].[IndexRootPathEntry]

SET IndexRootPath = 'server92513\EVIndex\Location1\EVIndex\index1'

WHERE IndexRootPath = '\\server95513\EVIndex\Location1\EVIndex\index1'

 

I have about 240 rows to change.

Is it possible within SQL, using some nifty selection option to change only the value 'server92' to the value 'server95'? This would leave less room for errors, as indexlocations are regularly moved, and several are added also. As you can guess, I am not a SQL guru :-). Any ideas welcome!

Thanks,

Gertjan

Regards. Gertjan
1 ACCEPTED SOLUTION

Accepted Solutions

Rob_Wilcox1
Level 6
Partner

Does this help:

 

 

update indexrootpathentry
set indexrootpath = '\\server92'+ substring(indexrootpath, 10, 500)
 
 
Replace the string with what you want to do.. replace the 10 with the number of characters of the current name (eg 10th char in)..  500 leave as is, it's just an arbitrary large number to get all the characters.
Working for cloudficient.com

View solution in original post

4 REPLIES 4

Rob_Wilcox1
Level 6
Partner

Does this help:

 

 

update indexrootpathentry
set indexrootpath = '\\server92'+ substring(indexrootpath, 10, 500)
 
 
Replace the string with what you want to do.. replace the 10 with the number of characters of the current name (eg 10th char in)..  500 leave as is, it's just an arbitrary large number to get all the characters.
Working for cloudficient.com

GertjanA
Moderator
Moderator
Partner    VIP    Accredited Certified

Damn, your good. Thanks Rob.

I'll check before setting solution

Regards. Gertjan

GertjanA
Moderator
Moderator
Partner    VIP    Accredited Certified

Works like a charm!

Regards. Gertjan

Rob_Wilcox1
Level 6
Partner

Glad to help.

Working for cloudficient.com