Skip to content

Instantly share code, notes, and snippets.

@smaglio81
Created September 9, 2018 06:02
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 smaglio81/764cbd996c075ac781d34649b485c6e5 to your computer and use it in GitHub Desktop.
Save smaglio81/764cbd996c075ac781d34649b485c6e5 to your computer and use it in GitHub Desktop.
use IisLogs
go
declare @dateStart varchar(10) = '2018-08-01',
@dateEnd varchar(10) = dateadd(d, 1, '2018-09-01'),
@includeAll bit = 1;
insert into dbo.IisLogWebAppId
select EntryTime, LogFilename, RowNumber,
dbo.fn_FindWebAppId([SiteName], csUriStem) [webAppId]
from dbo.IisLog
where (
(EntryTime >= @dateStart and EntryTime < @dateEnd)
or @includeAll = 1
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment