Forum Replies Created

Viewing 15 posts - 1 through 15 (of 69 total)

  • RE: List all Usernames, Roles for all the databases.

    Hi All,

    The script is updated to get the integer value of the major version number; instead of comparing the varchar values. also, this script will work for all the...

  • RE: List all Usernames, Roles for all the databases.

    Hi MMcPherson,

    This will work more so becasue this statement will truncate the 10 and 11 to 1 (due to varchar(1)) and compare that against 1.

    More accurate statement would be:

    IF LEFT(CAST(Serverproperty('ProductVersion')...

  • RE: List all Usernames, Roles for all the databases.

    Hi gshouse,

    Actually, this script will work for 2000, 2005, 2008 and hopefully 2012. I dont know if this will work for 6.5 though.

    The reason is sys tables that have...

  • RE: List all Usernames, Roles for all the databases.

    I have updated the script to get data for SQL Server 2008(tested) and SQL Server 2012(not tested). Once it gets published, you can get the script from the webpage. But...

  • RE: List all Usernames, Roles for all the databases.

    David, Thank you for the kind words!!

  • RE: Remove comments from the SQL Code

    I originally wrote this function, to be used in another function that searches for a keyword in the stored procedures. I was getting false hits for the words in the...

  • RE: Remove comments from the SQL Code

    You can handle all the nested comments by using the following code:

    DECLARE

    @comment VARCHAR(100),

    @endPosition INT,

    @startPosition INT,

    @commentLen INT,

    @substrlen INT,

    @len INT

    WHILE (CHARINDEX('/*',@def)<>0)

    BEGIN

    SET @endPosition = charindex('*/',@def)

    SET @substrlen=len(substring(@def,1,@endPosition-1))

    SET @startPosition...

  • RE: Remove comments from the SQL Code

    Hi Rajesh

    SELECT * FROM dbo.Ufn_RemoveComments2 (' HELLO /* WORLD */ ')

    This code doesn't seem to yield any results using your function. It does work nicely with nested comments.

  • RE: List all Usernames, Roles for all the databases.

    FreeHansje (7/8/2009)


    It might be a great script, but I still have the errors mentioned in the first posting; I thought it was rectified. I cannot find an easy way to...

  • RE: List all Usernames, Roles for all the databases.

    adam (4/6/2009)


    Can someone post the modified script for 2008?

    Hi Adam,

    I made changes to the code so that it would work on 2008 as well. Post back if you see...

  • RE: Multiple Transaction Log Files

    Hi Krishna, I was talking about shrinking log file with TruncateOnly option. I thought it was apparent in the script I posted, perhaps not. For the record, we both are...

  • RE: Multiple Transaction Log Files

    Shivaram Challa (3/26/2009)One should monitor log file regularly and should be taking regular transaction log backups.

    Now, if taking log backups isn't needed, then you can do a "dbcc Shrinkfile"...

  • RE: Multiple Transaction Log Files

    Krishna Potlakayala (3/26/2009) You would not be able to shrink the log file unless you truncate it. When the sys.databases "log_reuse_wait_dec" coulmn status is "LOG_BACKUP", then you should first take...

  • RE: List all Usernames, Roles for all the databases.

    Hi Rubinasd,

    SID is a security identifier for the login, you can get the loginname from sys.syslogins table.

    Name is the UserName in the corresponding database, for the corresponding login.

    My take at...

  • RE: Multiple Transaction Log Files

    One should monitor log file regularly and should be taking regular transaction log backups.

    Now, if taking log backups isn't needed, then you can do a "dbcc Shrinkfile" on...

Viewing 15 posts - 1 through 15 (of 69 total)