A Pen by Eric Fickes on CodePen.
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 column in all databases */ | |
DECLARE @db_name varchar(100), | |
@col_name varchar(100), | |
@sql_statement nvarchar(MAX) | |
-- column you are looking for | |
SET @col_name = 'PLANNED_SAMPLE_ID' | |
-- fill cursor with database names |
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
#region removeQuote | |
/// <summary> | |
/// Replace all double "s in a string with single 's | |
/// * this also removes " | |
/// </summary> | |
/// <param name="dirty"></param> | |
/// <returns></returns> | |
public static string replaceDoubleQuotes( string dirty ) | |
{ |
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
@echo off | |
@echo. | |
@echo '%1' | |
@echo ------------------------------------------------------------------------------- | |
@echo. | |
dir /s /b /o:g %1 | |
@echo. |
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
-- init vars | |
DECLARE @sessID int, | |
@dbName varchar(50), | |
@userName varchar(50) | |
SET @dbName = 'DA413' -- your database name | |
SET @userName = 'DA413' -- sql user account to look for | |
-- use a cursor to store all session_ids |
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
-- Give me all tables ending with an UPPERCASE X | |
SELECT table_name, SUBSTRING( table_name, LEN(table_name), 1 ) as 'end' | |
FROM INFORMATION_SCHEMA.TABLES | |
-- SELECT ascii('X') = 88 | |
-- SELECT ascii('x') = 120 | |
WHERE ASCII( SUBSTRING( table_name, LEN(table_name), 1 ) ) = 88 |
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
// split path using applicationId | |
var _appDir:Array = File.applicationDirectory.nativePath.split( | |
NativeApplication.nativeApplication.applicationID, 1 | |
); | |
// first item in array = root folder | |
trace( _appDir[0] ); |
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
<html> | |
<head> | |
<title>20 min datepicker</title> | |
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> | |
<script> | |
// id of HTML field to associate Datepicker with | |
var DT_FIELD = "date_field"; |
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
Use AdventureWorks | |
-- fill up temp table 1 ( [Schema], [Event] ) | |
SELECT DISTINCT [Schema], [Event] | |
INTO #tempTbl1 | |
FROM DatabaseLog | |
ORDER BY [Schema], [Event] | |
-- create delimited list | |
SELECT [Schema], |
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
USE AdventureWorks; | |
-- create a comma delimited list of CountryRegionCode per CurrencyCode | |
SELECT CurrencyCode, | |
MAX( COALESCE( CountryRegionCode + ', ', '') + CountryRegionCode ) AS 'RegionCodes' | |
FROM Sales.CountryRegionCurrency |
NewerOlder