Skip to content

Instantly share code, notes, and snippets.

@AshFlaw
Created January 10, 2019 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AshFlaw/c4a8ca387e31d06a389bc843667893db to your computer and use it in GitHub Desktop.
Save AshFlaw/c4a8ca387e31d06a389bc843667893db to your computer and use it in GitHub Desktop.
Create table for dbatools.io function WatchDbLogins to log to
USE [DatabaseLogins]
CREATE TABLE [dbo].[DbaTools-WatchDbLogins](
[ComputerName] [nvarchar](max) NULL,
[InstanceName] [nvarchar](max) NULL,
[SqlInstance] [nvarchar](max) NULL,
[LoginTime] [datetime2](7) NULL,
[Login] [nvarchar](max) NULL,
[Host] [nvarchar](max) NULL,
[Program] [nvarchar](max) NULL,
[DatabaseId] [smallint] NULL,
[Database] [nvarchar](max) NULL,
[IsSystem] [bit] NULL,
[CaptureTime] [datetime2](7) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment