This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- For production | |
--CREATE DATABASE [TrafficLogs] CONTAINMENT = NONE ON | |
--PRIMARY ( NAME = N'TrafficLogs', FILENAME = N'E:\Data\TrafficLogs.mdf' , SIZE = 102400000KB , FILEGROWTH = 5120000KB), | |
--FILEGROUP [TrafficLogs_D] ( NAME = N'TrafficLogs_D', FILENAME = N'D:\Data\TrafficLogs_D.ndf' , SIZE = 102400000KB, FILEGROWTH = 51200000KB), | |
--FILEGROUP [TrafficLogs_E] ( NAME = N'TrafficLogs_E', FILENAME = N'E:\Data\TrafficLogs_E.ndf' , SIZE = 1024000000KB, FILEGROWTH = 51200000KB) | |
--LOG ON ( NAME = N'TrafficLogs_log', FILENAME = N'D:\Data\TrafficLogs.ldf' , SIZE = 51200000KB , FILEGROWTH = 10240000KB) | |
--GO | |
-- For local development | |
Declare @dataPath nvarchar(500) = Cast(ServerProperty('instancedefaultdatapath') as nvarchar(500)), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Executes a Stored Procedure from Powershell and returns the first output DataTable | |
function Exec-Sproc{ | |
param($Conn, $Sproc, $Parameters=@{}) | |
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand | |
$SqlCmd.CommandType = [System.Data.CommandType]::StoredProcedure | |
$SqlCmd.Connection = $Conn | |
$SqlCmd.CommandText = $Sproc | |
foreach($p in $Parameters.Keys){ | |
[Void] $SqlCmd.Parameters.AddWithValue("@$p",$Parameters[$p]) |