Skip to content

Commit e900767

Browse files
2 parents 9106025 + 20f678d commit e900767

14 files changed

+15319
-3418
lines changed
+307
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,307 @@
1+
{
2+
"metadata": {
3+
"kernelspec": {
4+
"name": "SQL",
5+
"display_name": "SQL",
6+
"language": "sql"
7+
},
8+
"language_info": {
9+
"name": "sql",
10+
"version": ""
11+
}
12+
},
13+
"nbformat_minor": 2,
14+
"nbformat": 4,
15+
"cells": [
16+
{
17+
"cell_type": "markdown",
18+
"source": [
19+
"# Markdown in a SQL Notebook\r\n",
20+
"\r\n",
21+
"## A new Notebook\r\n",
22+
"\r\n",
23+
"To open a notebook in Azure Data Studio click File and New Notebook or `CTRL + SHIFT + N`\r\n",
24+
"\r\n",
25+
"![image](https://user-images.githubusercontent.com/6729780/59563108-6db4bc00-902d-11e9-9916-314f4f8f7187.png)\r\n",
26+
"\r\n",
27+
"In Azure Data Studio you should also get used to using the Command Palette to find commands with intellisense, this can be opened with `F1` and then if you type 'New N' you can create a new notebook\r\n",
28+
"\r\n",
29+
"![image](https://user-images.githubusercontent.com/6729780/59563149-0c411d00-902e-11e9-8127-68608e94a841.png)\r\n",
30+
"\r\n",
31+
"The blank Notebook enables you to start with a Code block or a Text Block. \r\n",
32+
"\r\n",
33+
"![image](https://user-images.githubusercontent.com/6729780/59563066-e49d8500-902c-11e9-90d0-f6feea9415bc.png)\r\n",
34+
"\r\n",
35+
"A Code block enables you to add T-SQL \r\n",
36+
"A Text block allows you to add Markdown\r\n",
37+
"\r\n",
38+
"\r\n",
39+
""
40+
],
41+
"metadata": {
42+
"azdata_cell_guid": "1e76a90d-05f6-465d-b55c-49b3c6579a5b"
43+
}
44+
},
45+
{
46+
"cell_type": "markdown",
47+
"source": [
48+
"# Using Markdown\r\n",
49+
"\r\n",
50+
"The Markdown language has some intricacies. \r\n",
51+
"\r\n",
52+
"# Spaces\r\n",
53+
"\r\n",
54+
"The one that catches me out the most often is the requirement for two spaces at the end of a line to add a line break\r\n",
55+
"\r\n",
56+
"This is line 1\r\n",
57+
"This is line 2 without any spaces\r\n",
58+
"\r\n",
59+
"\r\n",
60+
"This is line 1 \r\n",
61+
"This is line 2 with two spaces\r\n",
62+
"\r\n",
63+
"\r\n",
64+
""
65+
],
66+
"metadata": {
67+
"azdata_cell_guid": "2086a4c5-d204-4d0b-ba01-862e11d037b3"
68+
}
69+
},
70+
{
71+
"cell_type": "markdown",
72+
"source": [
73+
"# Headers\r\n",
74+
"\r\n",
75+
"Writing headers in Markdown uses `#`\r\n",
76+
"\r\n",
77+
"# One `#` (with a space) is the Biggest Header\r\n",
78+
"## Two `##` (with a space) is a little smaller\r\n",
79+
"### Three `###` (with a space) is smaller again\r\n",
80+
"#### Four `####` (with a space) is smaller again again\r\n",
81+
"etc\r\n",
82+
"\r\n",
83+
"\r\n",
84+
""
85+
],
86+
"metadata": {
87+
"azdata_cell_guid": "b6e297b2-6a68-4d18-a95b-e5e7774dc011"
88+
}
89+
},
90+
{
91+
"cell_type": "markdown",
92+
"source": [
93+
"### Emphasis\r\n",
94+
"\r\n",
95+
"You can **emphasise** text **in bold** with two `**` before and after a word or phrase \r\n",
96+
"You can *emphasise* text *with italics* with one `*` before and after a word or phrase \r\n",
97+
"You can ***emphasise*** text ***with bold AND italics*** with three `***` before and after a word or phrase \r\n",
98+
"You can <u>emphasise</u> text <u>by underlining</u> by enclosing it in `<u>` tags `<u>Text to underline</u>` \r\n",
99+
"You can **<u>emphasise</u>** text **<u>in bold and underlining</u>** with `**` before and after the `<u>` tags `**<u>Text to underline and bold</u>**` \r\n",
100+
"You can *<u>emphasise</u>* text *<u>in italics and underlining</u>* with `*` before and after the `<u>` tags `*<u>Text to underline and italicise</u>*` \r\n",
101+
"You can ***<u>emphasise</u>*** text ***<u>in bold and italics and underlining</u>*** with `***` before and after the `<u>` tags `*<u>Text to underline and embolden and italicise</u>*` \r\n",
102+
"\r\n",
103+
"### Quotes\r\n",
104+
"\r\n",
105+
"You can add a quote block using a `>` and a space before each line of the quote\r\n",
106+
"\r\n",
107+
"> Kid, the next time I say, Let's go someplace like Bolivia, \r\n",
108+
"> Let's go someplace like Bolivia.\r\n",
109+
"\r\n",
110+
""
111+
],
112+
"metadata": {
113+
"azdata_cell_guid": "3d238acc-649a-4dfd-bfc5-5339ad25917b"
114+
}
115+
},
116+
{
117+
"cell_type": "markdown",
118+
"source": [
119+
"# Lists\r\n",
120+
"\r\n",
121+
"To create an unordered bullet list use `-` and a space\r\n",
122+
"\r\n",
123+
"Here is a list of Data Events\r\n",
124+
"\r\n",
125+
"- Data Grillen\r\n",
126+
"- Data Saturday Holland\r\n",
127+
"- Data Relay\r\n",
128+
"- Data Scotland\r\n",
129+
"\r\n",
130+
"To indent the lists tab and then `-` and a space\r\n",
131+
"\r\n",
132+
"- Germany\r\n",
133+
" - Berlin\r\n",
134+
" - Munich\r\n",
135+
" - Lingen\r\n",
136+
" - Data Grillen\r\n",
137+
" - William Durkin\r\n",
138+
"- Netherlands\r\n",
139+
" - Amsterdam\r\n",
140+
" - Rotterdam\r\n",
141+
" - Apenhuel\r\n",
142+
"\r\n",
143+
"Creating a numbered list as you can imagine uses numbers and a . like this \r\n",
144+
"\r\n",
145+
" 1. first\r\n",
146+
" 2. second\r\n",
147+
"\r\n",
148+
"1. first\r\n",
149+
"2. second\r\n",
150+
"\r\n",
151+
"and indenting uses tabs as you expect\r\n",
152+
"\r\n",
153+
"1. first\r\n",
154+
" 1. first inside\r\n",
155+
" 2. second inside\r\n",
156+
" 1. first even further\r\n",
157+
" 3. third inside\r\n",
158+
"2. second\r\n",
159+
"\r\n",
160+
"However, all you need is to start with a `1.` (or possibly any smaller other number Which we think may be an int) after that any number will work!\r\n",
161+
"\r\n",
162+
" 1. Start with a 1.\r\n",
163+
" 7. After that any number will do!\r\n",
164+
" 1100. As high as you like!\r\n",
165+
"\r\n",
166+
"1. Start with a 1.\r\n",
167+
"7. After that any number will do!\r\n",
168+
"1100. As high as you like! \r\n",
169+
"\r\n",
170+
"and in the indentations as well\r\n",
171+
"\r\n",
172+
" 1. Start with a 1.\r\n",
173+
" 77. After that any number will do!\r\n",
174+
" 1. It works the same when indented\r\n",
175+
" 7. It's a bit odd\r\n",
176+
" 1. Feels a bit strange\r\n",
177+
" 47889. Because the Markdown orders the numbers\r\n",
178+
" 5. and they can be in any order\r\n",
179+
" 11. As high as you like!\r\n",
180+
"\r\n",
181+
"\r\n",
182+
"1. Start with a 1.\r\n",
183+
"77. After that any number will do!\r\n",
184+
" 1. It works the same when indented\r\n",
185+
" 5. It's a bit odd\r\n",
186+
" 1. Feels a bit strange\r\n",
187+
" 47889. Because the Markdown orders the numbers\r\n",
188+
" 5. and they can be in any order\r\n",
189+
"11. As high as you like!\r\n",
190+
""
191+
],
192+
"metadata": {
193+
"azdata_cell_guid": "594b6493-a56f-45f4-916a-333e11dc0074"
194+
}
195+
},
196+
{
197+
"cell_type": "markdown",
198+
"source": [
199+
"# Links\r\n",
200+
"\r\n",
201+
"You can add links in your notebook with `[Link Text](link)` like `[You can find my blog here](https://sqldbawithabeard.com)` \r\n",
202+
"\r\n",
203+
"[You can find my blog here](https://sqldbawithabeard.com)"
204+
],
205+
"metadata": {
206+
"azdata_cell_guid": "d7d7bf72-2b4b-4b3a-ab15-89b4fe7b648f"
207+
}
208+
},
209+
{
210+
"cell_type": "markdown",
211+
"source": [
212+
"\r\n",
213+
"\r\n",
214+
"# Images\r\n",
215+
"\r\n",
216+
"You can embed images into your notebook. You ***should*** be able to use local images but I cannot get it to work.\r\n",
217+
"\r\n",
218+
"Images are embedded with `![alt text](link to image)` like this `![image](https://user-images.githubusercontent.com/6729780/59564341-8036f180-903d-11e9-8e14-a773d62cf596.png)`\r\n",
219+
"\r\n",
220+
"![image](https://user-images.githubusercontent.com/6729780/59564341-8036f180-903d-11e9-8e14-a773d62cf596.png)\r\n",
221+
"\r\n",
222+
"You do not need to be connected to the internet to view the image in the notebook.\r\n",
223+
"\r\n",
224+
"I created the above link by opening a new issue iin a GitHub repository\r\n",
225+
"\r\n",
226+
"![image](https://user-images.githubusercontent.com/6729780/59564390-284cba80-903e-11e9-8a8c-a481b6da6fce.png)\r\n",
227+
"\r\n",
228+
"and then pasting the screenshot into the issue and copy the resulting code and paste into the Markdown block\r\n",
229+
"\r\n",
230+
"![image](https://user-images.githubusercontent.com/6729780/59564426-6b0e9280-903e-11e9-8b54-8e82e5959f80.png)\r\n",
231+
"\r\n",
232+
""
233+
],
234+
"metadata": {
235+
"azdata_cell_guid": "6a63ddf8-ec63-43bc-b037-9347dbd731c0"
236+
}
237+
},
238+
{
239+
"cell_type": "markdown",
240+
"source": [
241+
"\r\n",
242+
"<img src=\"https://user-images.githubusercontent.com/6729780/60736469-fbaa0580-9f4e-11e9-85ba-ec73907514bf.png\" height= \"750\" title=\"Hetfield\">\r\n",
243+
""
244+
],
245+
"metadata": {
246+
"azdata_cell_guid": "c72d4e7e-c059-46c8-9f01-79ceae282b6d"
247+
}
248+
},
249+
{
250+
"cell_type": "markdown",
251+
"source": [
252+
"\r\n",
253+
"\r\n",
254+
"# Code\r\n",
255+
"\r\n",
256+
"To add code to the Markdown use the backtick ` \r\n",
257+
"\r\n",
258+
"`SELECT @@VERSION`\r\n",
259+
"\r\n",
260+
"There is some formatting available also if you use ```` and the language\r\n",
261+
"\r\n",
262+
"````sql\r\n",
263+
"SELECT Name, IsAwesome\r\n",
264+
"FROM dbo.bands \r\n",
265+
"WHERE Name = 'Matallica'\r\n",
266+
"````\r\n",
267+
"\r\n",
268+
"````powershell\r\n",
269+
"$Bands | Where-Object {$Psitem.Name -eq 'Metallica'} | Select-Object Name, IsAWesome\r\n",
270+
"````"
271+
],
272+
"metadata": {
273+
"azdata_cell_guid": "bc4be48f-7c31-49ce-b237-9bcac781e6f3"
274+
}
275+
},
276+
{
277+
"cell_type": "markdown",
278+
"source": [
279+
"## Gifs\r\n",
280+
"\r\n",
281+
"You can also embed gifs into your notebooks in one of two ways\r\n",
282+
"\r\n",
283+
"`![image](https://media.giphy.com/media/Uahz9hecgXoJi/giphy.gif)` \r\n",
284+
"`<img src=\"https://media.giphy.com/media/cD00Ukp6FfXuU/giphy.gif\" height= \"264\" title=\"Hetfield\">`\r\n",
285+
"\r\n",
286+
"\r\n",
287+
"<img src=\"https://media.giphy.com/media/cLTMlkqqXLHCa9Jc4y/source.gif\" height= \"264\" title=\"Verstappen\"> <br>\r\n",
288+
"<img src=\"https://media.giphy.com/media/Yy6DnEzSwb4Gs/giphy.gif\" height= \"264\" title=\"Football\"> \r\n",
289+
"<img src=\"https://media.giphy.com/media/bjIICkViBAbUk/source.gif\" height= \"264\" title=\"Cruyff\"> \r\n",
290+
"<img src=\"https://media.giphy.com/media/pOEQPIKAJfWZdhpVZT/giphy.gif\" height= \"264\" title=\"Bike\"> \r\n",
291+
"\r\n",
292+
"\r\n",
293+
"\r\n",
294+
"<img src=\"https://media.giphy.com/media/3o85xBubCR8RAjZlzG/source.gif\" height= \"264\" title=\"Windmill\"> \r\n",
295+
"<img src=\"https://media.giphy.com/media/8P7y2ARUPFpNaaWEZ3/giphy.gif\" height= \"264\" title=\"Windmill\"> \r\n",
296+
"\r\n",
297+
"\r\n",
298+
"\r\n",
299+
"\r\n",
300+
""
301+
],
302+
"metadata": {
303+
"azdata_cell_guid": "3b0391ed-0c5c-4aaa-8994-2135b1710f54"
304+
}
305+
}
306+
]
307+
}

Diff for: notebooks/NotDotNet/Agent/AGENT - Exporting to source control.ipynb

+69-14
Large diffs are not rendered by default.

Diff for: notebooks/NotDotNet/Audit/AUDIT - Instance Permissions to Excel.ipynb

+7-7
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@
6666
},
6767
"outputs": [
6868
{
69+
"output_type": "stream",
6970
"name": "stdout",
70-
"text": "The PowerShell Gallery is trusted I will continue\nWe have the dbatools module already\nWe have the importExcel module already\n. {\n",
71-
"output_type": "stream"
71+
"text": "The PowerShell Gallery is trusted I will continue\nWe have the dbatools module already\nWe have the importExcel module already\n. {\n"
7272
}
7373
],
7474
"execution_count": 2
@@ -102,9 +102,9 @@
102102
},
103103
"outputs": [
104104
{
105+
"output_type": "stream",
105106
"name": "stdout",
106-
"text": "",
107-
"output_type": "stream"
107+
"text": ""
108108
}
109109
],
110110
"execution_count": 5
@@ -201,9 +201,9 @@
201201
},
202202
"outputs": [
203203
{
204+
"output_type": "stream",
204205
"name": "stdout",
205-
"text": "Processing SQL2017N5\n FileName is c:\\temp\\\\SQL2017N5_Permssions_OneTab_2020-05-30.xlsx\n\nFinished Processing SQL2017N5\n ############### \n FileName is c:\\temp\\\\SQL2017N5_Permssions_OneTab_2020-05-30.xlsx \n ############### \n\n",
206-
"output_type": "stream"
206+
"text": "Processing SQL2017N5\n FileName is c:\\temp\\\\SQL2017N5_Permssions_OneTab_2020-05-30.xlsx\n\nFinished Processing SQL2017N5\n ############### \n FileName is c:\\temp\\\\SQL2017N5_Permssions_OneTab_2020-05-30.xlsx \n ############### \n\n"
207207
}
208208
],
209209
"execution_count": 6
@@ -223,7 +223,7 @@
223223
"cell_type": "code",
224224
"source": [
225225
"$ExcelDirectory = 'c:\\temp\\' # Alter this to the directory you want the file created\r\n",
226-
"$SQlinstances = 'AnInstance','ANotherinstance' # Alter this for the SQL Instances you want to get permissions for\r\n",
226+
"$SQlinstances = 'SQL2017N5' # Alter this for the SQL Instances you want to get permissions for\r\n",
227227
"\r\n",
228228
"foreach($sqlinstance in $SQlinstances){\r\n",
229229
"Write-Output \"Processing $sqlinstance\"\r\n",

0 commit comments

Comments
 (0)