Viewing 5 posts - 1 through 5 (of 5 total)
Figured it out. It was a cloud thing. Backlashes needed to be forward slashes.
Thanks for looking at it though.
July 9, 2020 at 7:16 pm
SELECT db.name AS database_name, mf.name as actual_logical_name,
LEFT(REVERSE(LEFT(REVERSE(mf.Physical_Name),CHARINDEX('\', REVERSE(mf.Physical_Name), 1) - 1)),
LEN(REVERSE(LEFT(REVERSE(mf.Physical_Name),CHARINDEX('\', REVERSE(mf.Physical_Name), 1) - 1))) - 4) as new__logical_name,
'ALTER DATABASE ['+db.name +'] MODIFY FILE (NAME=N'''+ mf.name + ''',NEWNAME=N'''+
LEFT(REVERSE(LEFT(REVERSE(mf.Physical_Name),CHARINDEX('\', REVERSE(mf.Physical_Name), 1)...
July 9, 2020 at 6:46 pm
I've reattached the script as a *.txt file. The forum didn't accept the use of a *.sql file. Understandable.
It runs against all DBs, tables and dbnames are not relevant.
July 9, 2020 at 6:45 pm
I found a solution that achieves the goal and thought I would share. The following script by Shiva Challa.
USE MASTER
GO
BEGIN
DECLARE @SQLVerNo INT;
SET @SQLVerNo = cast(substring(CAST(Serverproperty('ProductVersion') AS VARCHAR(50)) ,0,charindex('.',CAST(Serverproperty('ProductVersion') AS VARCHAR(50))...
July 1, 2020 at 4:30 pm
Thanks. That is helpful information to keep me from spinning my wheels. 🙂
July 1, 2020 at 2:56 pm
Viewing 5 posts - 1 through 5 (of 5 total)