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
--Example of a using a full join to compare and find missing values in two tables | |
--http://www.jeffspiller.net/2016/09/full-joins.html | |
--Copyright 2016 Jeff Spiller. All rights reserved. | |
--Licensed under the MIT License -- License Details at https://opensource.org/licenses/MIT | |
create table #inventory1 (itemId_t1 int, count_t1 int); | |
create table #inventory2 (itemId_t2 int, count_t2 int); | |
--# |
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
--More Info:http://www.jeffspiller.net/2016/06/fun-with-unicode-and-sql-server.html | |
--Copyright 2016 Jeff Spiller. All rights reserved. | |
--Licensed under the MIT License -- License Details at https://opensource.org/licenses/MIT | |
use tempdb | |
create table #unicodeTest (ascii_char varchar(1),unicode_char nvarchar(1) ) | |
insert into #unicodeTest values | |
('a',N'a'), | |
('b',N'b'), | |
('c',N'c') |
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
--Step 1 Link to the Database | |
--More info: http://jeffspiller.net/2016/01/moving-data-with-linked-databases.html | |
--Copyright 2016 Jeff Spiller. All rights reserved. | |
--Licensed under the MIT License -- License Details at https://opensource.org/licenses/MIT | |
Use master | |
if | |
(select count(name) from sys.servers where name='AzureTest' ) =1 | |
begin |
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
-- Prep - Create a table for the 'mailing list' | |
--More info: http://jeffspiller.net/2016/01/moving-data-with-linked-databases.html | |
--Copyright 2016 Jeff Spiller. All rights reserved. | |
--Licensed under the MIT License -- License Details at https://opensource.org/licenses/MIT | |
USE [AdventureWorks2014] | |
GO |
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
--linkedAzureServer.sql | |
--Example of a linked server between SQL SERVER 2014 and SQL Azure | |
--More info: http://jeffspiller.blogspot.com/2015/12/using-linked-server-with-azure.html | |
--Copyright 2015 Jeff Spiller. All rights reserved. | |
--Licensed under the MIT License -- License Details at https://opensource.org/licenses/MIT | |
use master | |
EXEC sp_addlinkedserver | |
@server='AzureTest', --this is name name you use in the query |
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
# runSQL.ps1 | |
# simple command line SQL interpreter for Microsoft SQL Server | |
# More info: http://www.jeffspiller.net/2015/12/command-line-sql-server-interpreter-sql.html | |
# Copyright 2015 Jeff Spiller. All rights reserved. | |
# Licensed under the MIT License -- License Details at https://opensource.org/licenses/MIT | |
############################# | |
### config #### | |
############################# | |
$sqlServer="mypc\sqlexpress" |
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
//Math examples | |
// jeffspiller.net | |
// Copyright 2014 Jeff Spiller. All rights reserved. | |
//Licensed under the MIT License -- License Details at https://opensource.org/licenses/MIT | |
package main | |
import ( |
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
//variable declarations 'shortcut' | |
// jeffspiller.net | |
// Copyright 2014 Jeff Spiller. All rights reserved. | |
//Licensed under the MIT License -- License Details at https://opensource.org/licenses/MIT | |
package main | |
//Here's how you do more than one import | |
import ( | |
"fmt" |
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
//exmples of varaible declarations | |
// jeffspiller.net | |
// Copyright 2014 Jeff Spiller. All rights reserved. | |
//Licensed under the MIT License -- License Details at https://opensource.org/licenses/MIT | |
package main | |
import "fmt" | |
func main() { | |
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
//The ever popular "hello world" program | |
// jeffspiller.net | |
// Copyright 2014 Jeff Spiller. All rights reserved. | |
//Licensed under the MIT License -- License Details at https://opensource.org/licenses/MIT | |
package main | |
import "fmt" | |
func main() { |