Category Archives: Security
Easy Security Fixes
Here are some security tasks I've been tackling lately.
1. Find weak passwords and change them.
I keep track of application logins and passwords using a product called KeePass. It has a plugin called strengthreport that you can use to make a report or .csv showing the strength of your passwords. Use the SVN command … Continue Reading ››See all roles on your server
This cursor inserts all of the roles and members from each database into your admin database.
USE [SQL_DBA_Sandbox]
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Roles]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Roles](
[DBName] [varchar](max) NULL,
[Role] [varchar](max) NULL,
[Member] [varchar](max) NULL
) ON [PRIMARY]
END
ELSE
Continue Reading ››See all the schemas on your server
Oh no! A useful cursor?
DECLARE @DB_NAME sysname;
SET @DB_NAME = NULL;
CREATE TABLE #RESULTS
(TABLE_CATALOG sysname,
TABLE_SCHEMA sysname)
DECLARE @SQL VARCHAR(2000);
DECLARE Cursor_DB CURSOR FAST_FORWARD READ_ONLY FOR
SELECT name FROM sys.databases
WHERE database_id > 4
OPEN Cursor_DB
FETCH NEXT FROM Cursor_DB INTO @DB_NAME
WHILE … Continue Reading ››