I hereby claim:
- I am develohpanda on github.
- I am ohpanda (https://keybase.io/ohpanda) on keybase.
- I have a public key ASDZd5ZUSTt-dEnpHZxxxWwhncl2htpgKO4q9V82M7-9MAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
DROP TABLE IF EXISTS #toDelete | |
SELECT bmi.* INTO #toDelete | |
FROM [dbo].[BCS_Main_Input_With_absence_Holiday_And_Wage_Elements] bmi | |
INNER JOIN @fiscalWeeksForRelease fw | |
on | |
fw.FISCAL_YEAR = bmi.Fiscal_Year | |
AND fw.FISCAL_WEEK = bmi.Fiscal_Week | |
INNER JOIN @StoresInRelease s | |
on | |
s.Store_Id = bmi.Store_ID |
update ft | |
set ft.description = 'test' | |
from firstTable ft | |
inner join secondTable st on | |
ft.id = st.id |
function Run-SqlCommand($serverName, $databaseName, $command, $timeoutSeconds = 30) { | |
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection | |
$SqlConnection.ConnectionString = "Server=$serverName;Database=$databaseName;Integrated Security=True" | |
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand | |
$SqlCmd.CommandText = $command | |
$SqlCmd.Connection = $SqlConnection | |
$SqlCmd.CommandTimeout = $timeoutSeconds | |
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter | |
$SqlAdapter.SelectCommand = $SqlCmd | |
$DataSet = New-Object System.Data.DataSet |
function Delete-SqlDatabase($serverName, $databaseName) { | |
Import-Module SQLPS | |
$server = New-Object Microsoft.SqlServer.Management.Smo.Server($serverName) | |
$db = $server.databases[$databaseName] | |
if ($db) { | |
$server.KillAllprocesses($databaseName) | |
$db.Drop() | |
} | |
} |
function convertTimestamp(timestamp) { | |
var d = new Date(timestamp * 1000), // Convert the passed timestamp to milliseconds | |
yyyy = d.getFullYear(), | |
mm = ('0' + (d.getMonth() + 1)).slice(-2), // Months are zero based. Add leading 0. | |
dd = ('0' + d.getDate()).slice(-2), // Add leading 0. | |
hh = d.getHours(), | |
h = hh, | |
min = ('0' + d.getMinutes()).slice(-2), // Add leading 0. | |
ampm = 'AM', | |
time; |
UPDATE STATISTICS sys.syscolpars | |
UPDATE STATISTICS sys.sysschobjs | |
UPDATE STATISTICS sys.syssingleobjrefs | |
UPDATE STATISTICS sys.sysiscols | |
GO |
public static class AsyncHelpers | |
{ | |
/// <summary> | |
/// Execute an async method which has a void return value synchronously | |
/// </summary> | |
/// <param name="method">Task<T/> method to execute</param> | |
public static void RunSync(Func<Task> method) | |
{ | |
Argument.CheckIfNull(method, nameof(method)); |
DateTime.From(Number.Round((Number.From([Time]) * 24 * 3600)/RoundToNearestXSecond, 0)*RoundToNearestXSecond/(24*3600)) |
/// <summary> | |
/// Selects a random element from input list using the allocations remaining to sway selection | |
/// T must have AllocationRemaining, Weight and Id properties on it. | |
/// </summary> | |
public T SelectRandom<T>(List<T> objects) | |
{ | |
int totalWeight = 0; | |
T selected = default(T); | |
foreach (T obj in objects) | |
{ |