This file contains hidden or 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
-- Helper view so that you can call CRYPT_GEN_RANDOM in your function | |
CREATE VIEW [dbo].[SecureRandomBytes] | |
AS | |
SELECT [RandBytes] = CRYPT_GEN_RANDOM(2) | |
GO | |
-- Function for generating secure random string | |
CREATE FUNCTION [dbo].[SecureRandomString](@sLength tinyint) | |
RETURNS varchar(200) | |
AS |
This file contains hidden or 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
-- ref: https://dba.stackexchange.com/a/159886 | |
-- run this script against a user database, not master | |
-- count number of plans currently in cache | |
select count(*) from sys.dm_exec_cached_plans; | |
-- Executing this statement will clear the procedure cache in the current database, which means that all queries will have to recompile. | |
ALTER DATABASE SCOPED CONFIGURATION CLEAR PROCEDURE_CACHE; | |
-- count number of plans in cache now, after they were cleared from cache |
This file contains hidden or 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
if test -f /etc/profile.d/git-sdk.sh | |
then | |
TITLEPREFIX=SDK-${MSYSTEM#MINGW} | |
else | |
TITLEPREFIX=$MSYSTEM | |
fi | |
if test -f ~/.config/git/git-prompt.sh | |
then | |
. ~/.config/git/git-prompt.sh |
This file contains hidden or 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
using System; | |
using System.Linq; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
public class Program | |
{ | |
// CAREFUL! IEnumerable can be inefficient and slow. | |
public static void Main() | |
{ |