Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)

  • Reply To: Script works on one server, errors on others

    Figured it out.  It was a cloud thing. Backlashes needed to be forward slashes.

    Thanks for looking at it though.

  • Reply To: Script works on one server, errors on others

    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)...

  • Reply To: Script works on one server, errors on others

    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.

    Attachments:
    You must be logged in to view attached files.
  • Reply To: List of all users for all databases

    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))...

  • Reply To: List of all users for all databases

    Thanks. That is helpful information to keep me from spinning my wheels. 🙂

Viewing 5 posts - 1 through 5 (of 5 total)