All posts by Sam

Curly Quotes

Someone was talking about curly quotes and how we shouldn't type them because the code interpreter for some the software we are dealing with wouldn't like them (like most other languages). So I started thinking - “how the heck would I even type a curly quote”? It's pretty easy.


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 ››