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
| -- Based on this article: http://modern-sql.com/use-case/pivot | |
| set nocount on | |
| declare @Table table ( | |
| TableName char(20), | |
| AttributeName char(20), | |
| AttributeValue char(20), | |
| -- Mandatory: Each attribute must appear precisely once for each element. |
https://github.com/codesmithtools
All ****.zip files contain entire application templates.
This one actually creates SQL from the schema:
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
| dotnet new mvc -o MyProject | |
| cd MyProject | |
| REM CodeGenerators.Mvc added as package | |
| dotnet add package "Microsoft.VisualStudio.Web.CodeGeneration.Design" | |
| dotnet add package "Microsoft.VisualStudio.Web.CodeGenerators.Mvc" | |
| REM CodeGeneration.Tools added as reference (not package) as it is tooling. | |
| dotnet add reference "Microsoft.VisualStudio.Web.CodeGeneration.Tools" |
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
| ---------------------------------------------------------------------------------------------------- | |
| -- AUDITING WITH TRIGGERS | |
| -- Written by Daniel Loth | |
| ---------------------------------------------------------------------------------------------------- | |
| -------------------------------------------------------------------------------- | |
| -- Populate a numbers table | |
| -------------------------------------------------------------------------------- | |
| drop table if exists Number | |
| go |
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
| # Negotiating salary | |
| https://www.reddit.com/r/personalfinance/comments/7psra0/reminder_never_tell_hr_how_much_you_make_or_are/ | |
| ----- | |
| Reddit user sadakxp (https://www.reddit.com/user/sadakxp) made this post: | |
| Here's why this is not fair and what you should do about it, as a person interviewing. |
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 text from Payroll.sys.syscomments where id = 55086; | |
| select * from sys.sql_modules where [object_id] = 55086; | |
| select value from STRING_SPLIT( | |
| (select [definition] from Payroll.sys.sql_modules where [object_id] = 55086), char(10)); | |
| select value from STRING_SPLIT( | |
| (select replace([definition], char(13), '') from Payroll.sys.sql_modules where [object_id] = 55086), char(10)); |
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
| # Assumption: Your remotes are configured as 'origin' (for personal fork) and 'upstream' (for shared git repo). | |
| # First, make sure your local workspace is clean | |
| git status | |
| # If it isn't, either create a WIP branch OR stash your changes | |
| # WIP branch: | |
| git checkout -b my-current-WIP-19-mar-2021 | |
| git add * | |
| git commit -m 'WIP' |
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
| create procedure dbo.AddAttendance_tr | |
| @OrganisationId int, | |
| @PersonId int, | |
| @AttendanceDate date | |
| as | |
| set nocount on; | |
| ------------------------------------------------------------ | |
| -- Validation block |