Saturday, June 13, 2020

Pagination in SQL Server (Thank you https://www.sqlshack.com/pagination-in-sql-server/)

Select TOP(100) LastName, FirstName FROM Person.Person ORDER BY LastName

DECLARE @PageNumber AS INT
DECLARE @RowsOfPage AS INT
DECLARE @SortingCol AS VARCHAR(100) ='FirstName'
DECLARE @SortType AS VARCHAR(100) = 'ASC'
SET @PageNumber=1
SET @RowsOfPage=50
SELECT LastName, FirstName FROM Person.Person
ORDER BY
CASE WHEN @SortingCol = 'Lastname' AND @SortType ='ASC' THEN LastName END ,
CASE WHEN @SortingCol = 'LastName' AND @SortType ='DESC' THEN LastName END DESC,
CASE WHEN @SortingCol = 'FirstName' AND @SortType ='ASC' THEN FirstName END ,
CASE WHEN @SortingCol = 'FirstName' AND @SortType ='DESC' THEN FirstName END DESC
OFFSET (@PageNumber-1)*@RowsOfPage ROWS
FETCH NEXT @RowsOfPage ROWS ONLY

SET @PageNumber=2
SET @RowsOfPage=50
SET @SortingCol ='LastName'
SET @SortType = 'ASC'
SELECT LastName, FirstName FROM Person.Person
ORDER BY
CASE WHEN @SortingCol = 'Lastname' AND @SortType ='ASC' THEN LastName END ,
CASE WHEN @SortingCol = 'LastName' AND @SortType ='DESC' THEN LastName END DESC,
CASE WHEN @SortingCol = 'FirstName' AND @SortType ='ASC' THEN FirstName END ,
CASE WHEN @SortingCol = 'FirstName' AND @SortType ='DESC' THEN FirstName END DESC
OFFSET (@PageNumber-1)*@RowsOfPage ROWS
FETCH NEXT @RowsOfPage ROWS ONLY

Sunday, April 26, 2020

Get Rid of Ants and other Insects and Win the War!!!

Ants (AGGGGGHHHH!!!) sugar ants,  carpenter ants, or fire ants.  At least I can identify fire ants because they are red or are they? Who knows what kind of ants.  Who cares, you just don't want them or other insects in your home.  PERIOD! 

As other homeowners know you have two choices hire an exterminator $$$$$ or do it yourself.  Well, I am here to tell you what is working for our home.

Disclaimer - Safety first, use a respirator, rubber gloves, and rubber boots.

1. Mix as instructed I did two full and an extra 1/2 squeezes to one gallon of water in a pump sprayer, fill slowly with water to get a good mix (stronger is better.  Then spray your entire home around doors, windows, foundation one foot up and two to three feet out -  

Bayer - 4031982 - Suspend SC -Insecticide - 16oz

https://amzn.to/3bYaDNG

2. Sprinkle every 4 feet around the entire perimeter of your home.

Niban Granular Insect Bait 

https://amzn.to/2YplKeA

3. Inside the house issue purchase 

Southern Homewares Pesticide Diatomaceous Earth Hand Bellows Powder Duster - Garden Powder Bulb Applicator - Great Against Bedbugs & Insects

https://amzn.to/3aXCJYb

4. Sprayer I purchased and use a sharping and mark it for safety:

Chapin 20000 1 Gallon Lawn, Sprayer

https://amzn.to/35pKnJv


REPEAT EVERY 2 MONTHS TO ENSURE MAINTAINED DEFENSE.