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
# Demo - Sending hash argument as function parameters | |
$hash = @{ "param1"=1; "param2"=2 }; | |
$hash; | |
function testHash($param1=$null, $param2=$null) | |
{ | |
return $($param1 + $param2); | |
} |
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
select columns from openrowset ('sqloledb', 'machineIP';'userName';'password', | |
'SELECT columns from table') |
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
SELECT * INTO newschema.MyNewTableName | |
FROM OPENQUERY([MY_SOURCE_SERVER_NAME], | |
'SELECT * from [source_database_name].[schema_name].[TableName]'); |
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
http://git-scm.com |
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
"Test 1.1.1.1" -replace "(?<first>\d+\.\d+\.\d+\.)\d+", '${1}2' |
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
netsh interface portproxy add v4tov4 listenport=port1 listenaddress=* connectport=port2 connectaddress=address |
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
SELECT orderid, orderdate, custid, empid | |
FROM Sales.Orders | |
ORDER BY orderdate DESC, orderid DESC | |
OFFSET 50 ROWS FETCH NEXT 25 ROWS ONLY; |
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
WITH RunningTotals AS | |
( | |
SELECT custid, orderid, orderdate, val, | |
SUM(val) OVER(PARTITION BY custid | |
ORDER BY orderdate, orderid | |
ROWS BETWEEN UNBOUNDED PRECEDING | |
AND CURRENT ROW) AS runningtotal | |
FROM Sales.OrderValues | |
) | |
SELECT * |
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
1. FOR XML RAW('Customer'), ROOT('Customers') | |
-> rows are node xml elements with <Customer ColumnName="ColumnValue" /> | |
-> columns are attributes | |
-> root is customers | |
2. FOR XML ROW('Customer'), ROOT('Customers'), ELEMENTS | |
-> columns are xml elements | |
3. FOR XML ROW('Customer'), ROOT('Customers'), ELEMENTS XSINIL |
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
(* Copyright © 2014 G Roberts. All Rights Reserved *) | |
namespace MiniForum.Model | |
open System | |
open System.Threading.Tasks | |
open MiniForum | |
open MiniForum.Model | |
open Fredis |
OlderNewer