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 | |
| --s.clastname as 'lastname', | |
| --s.cfirstname as 'firstname', | |
| s.clastname + ', ' + s.cFirstName + ' (' + ltrim(rtrim(cast(s.istudentid as CHAR))) + ')' as [combinedname], | |
| dbo.getgradesname(s.igradesid) as [grade], | |
| h.cName as [homeroom], | |
| l.cphone as [phone], | |
| --a.iClassID as [class], | |
| --a.ddate as [date], | |
| ( select COUNT(*) from Attendance att |
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
| ------------------------------------------------------------------------------------ | |
| --first term | |
| update Class | |
| set iLV_SessionID = 258 | |
| where iclassid in | |
| (select iclassid from Class |
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
| drop table #contactrelation | |
| drop table #contact | |
| drop table #location | |
| declare @ischoolid int | |
| set @ischoolid = 1 | |
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
| drop table #temptable | |
| select sObj.name as cTable, sCol.name as cColumn | |
| into #temptable | |
| from sys.tables sTable | |
| inner join sys.columns sCol | |
| on sCol.object_id = sTable.object_id | |
| inner join sys.objects sObj | |
| on sCol.object_id = sObj.object_id | |
| inner join sys.types sType |
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
| begin transaction | |
| delete from contact | |
| --cstreet is too small | |
| alter table location alter column cstreet varchar(70) | |
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
| /* | |
| Trying to randomize the records in dbo.BestOfRequestDetail, but preserve them in sets of 10 by iBestOfRequestID. | |
| */ | |
| --clean up overall | |
| if object_id('tempdb..#newresults') is not null | |
| drop table #newresults; | |
| if object_id('tempdb..#finalresults') is not null | |
| drop table #finalresults; |
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 table #SIRSusers (iCount int, cName varchar(100)) | |
| create table #TLXEusers (iCount int, cName varchar(100)) | |
| create table #HLSusers (iCount int, cName varchar(100)) | |
| create table #HLCusers (iCount int, cName varchar(100)) | |
| create table #totals (iCount int, cName varchar(100)) | |
| --HLS users |
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 * from a | |
| ------total requests by IP | |
| ----select f9, count(*) from a | |
| ----group by f9 | |
| ----order by 2 desc | |
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
| try { | |
| # check if SEP.cloud installed | |
| $sym = Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Where {$_.DisplayName -eq "Symantec Endpoint Protection.cloud"} | |
| # if SEP.cloud is not installed | |
| if(! $sym){ | |
| ## first elevate to admin. Benjamin Armstrong | |
| # Get the ID and security principal of the current user account |
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
| while (<>) { | |
| $_ =~ s/\[\s+\d\]//g; | |
| $_ =~ s/\s+/,/g ; | |
| $_ =~ s/^,|,$//g; | |
| print split(/\n/,$_); | |
| print "\n"; | |
| } |