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
// Formats the value as an exponential as a multiple of 3 | |
// NOTE: The result is a string that is still a valid floating point number | |
function toTrioExponential(value, fixedDigits) | |
{ | |
var mag = parseInt(Math.log(Math.abs(value) / Math.LN10); | |
var rem = mag % 3; | |
if (rem == 2) | |
++mag; | |
else if ((rem == 1) || (rem == -2)) | |
--mag; |
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
-- ===================================== | |
-- ==== FIND CHANGES in SQL OBJECTS ==== | |
-- ===================================== | |
-- Optional: Find changes ig LOG Trace file | |
DECLARE @search_log bit = 1 -- 0=Do not search trace log; 1=Search trace log (WARNING: SLOW!!) | |
-- ============================================================================ | |
-- Search sys.objects | |
SELECT TOP (10000) |
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
<# | |
.SYNOPSIS | |
Returns the SID for the specified credentials | |
.DESCRIPTION | |
Returns the SID for a user name, using System.Security.Principal.NTAccount. If | |
no UserName is specified, then the current user name is used. | |
.NOTES | |
History: |
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
-- ************************************************************************************************************************* | |
-- Name - Create-Merge-Script.sql | |
-- Description - Generates a SQL script to manage table data using XML with MERGE. | |
-- - Change variable @table to the desired output table name, and add @ignore_columns as necessary | |
-- - The output will be SQL lines that can be saved as a script | |
-- Author - Ryan van Slooten | |
---------------------------------------------------------------------------------------------------------------------------- | |
-- Change Date Change By Ver. Changes | |
---------------------------------------------------------------------------------------------------------------------------- | |
-- 2017-02-27 rjvs 1.0.4 Added comment block |
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
-- Paste Middleware XML in @xml parameter value | |
DECLARE @xml xml = N'<request><object>QDC_sample</object><msgtype>getspec</msgtype><cmd>GetTableData</cmd><filter><start_time_utc>2017-11-16T12:02:51</start_time_utc><end_time_utc>2018-02-14T17:02:51.283857</end_time_utc><num_rows>180</num_rows><ent_id>32</ent_id><cols><columns><column><id>Col1</id><dataType>Attributes</dataType><label>Shift</label><attrId>38</attrId><operation>Forming Machine</operation><charId /><field>sa.attr_value</field><QDCSpecification>38946</QDCSpecification><queryType>sample_attr</queryType><orderOrLocation>valueNo</orderOrLocation><valueNo /><location /></column><column><id>Col2</id><dataType>Attributes</dataType><label>Crew</label><attrId>35</attrId><operation>Forming Machine</operation><charId /><field>sa.attr_value |