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
| 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
| 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
| 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
| ------------------------------------------------------------------------------------ | |
| --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
| 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
| --function to trim street info | |
| IF object_id(N'fn_doStuff', N'FN') IS NOT NULL | |
| DROP FUNCTION fn_doStuff | |
| GO | |
| CREATE FUNCTION fn_doStuff | |
| ( @value nvarchar(500) ) |
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
| update Settings set cValue='N' where cKey like 'LDAP/Login' | |
| --begin transaction | |
| declare @icourseObjectiveID int | |
| declare @csubject varchar(500) | |
| declare @mnotes varchar(500) |
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
| use eastcentral | |
| SET NOCOUNT ON | |
| 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
| declare @command varchar(1000) | |
| IF OBJECT_ID('tempdb..#temptable') IS NOT NULL DROP TABLE #temptable | |
| select distinct | |
| S.cStudentNumber, | |
| s.cGovernmentNumber as 'Government Number', | |
| s.cLegalLastName as 'Legal Last Name', | |
| s.cLegalFirstName as 'Legal First Name', | |
| us.UF_1590, |