Sending a text message from SQL Server

You must have database mail enabled for this stored procedure to work. (Sorry for the bad formatting.. I’m still looking for a good code-prettyfier.)

CREATE proc dbo.[SendTextMessage](
@number nvarchar(255)
,@message nvarchar(255)
,@subject nvarchar(255) = null
,@provider nvarchar(20) = ‘Verizon’
)
as
begin
set nocount on;

set @number = ltrim(rtrim(@number));
if @number is null or len(@number)<7 begin;
set @message = ‘@number is too short’;
throw 50000, @message, 1;
end;

set @message = ltrim(rtrim(@message));
if @message is null or len(@message)<2 begin;
set @message = ‘@message is too short’;
throw 50000, @message, 1;
end;

set @subject = ltrim(rtrim(@subject));
if @subject is null set @subject = @@SERVERNAME + N’ Notification’;

declare @to nvarchar(255) = @number + N’@’+
case @provider
when ‘Verizon’ then N’vtext.com’
when ‘VZ’ then N’vtext.com’
when ‘ATT’ then N’txt.att.net’
when ‘SPRINT’ then N’messaging.sprintpcs.com’
when ‘TMOBILE’ then N’tmomail.net’
end;
if nullif(@provider,N’@’) is null begin;
throw 51000, ‘Unknown provider. Message not sent.’, 1;
end;

declare @mailitem_id INT;
exec msdb.dbo.sp_send_dbmail @recipients = @to, @subject = @subject, @body = @message, @mailitem_id=@mailitem_id output;
end

 

Advertisements

Google Chrome: Fix to remove all ‘Other Search Engines’.

Found via Google Chrome: Remove all ‘Other Search Engines’ – Super User.

Finally! I’m so tired of every little site I visit adding baggage into my Chrome browser.
There really should be an option to add a site, WHEN I DESIRE TO DO SO.

Freakin’ chrome design team. Grr.

Meanwhile, there is a chrome extension that is supposed to block these silent custom search engine additions: “Don’t add custom search engines“.

Here’s to hoping it works!

[Free] Online Link Expander & Decrypter

@ Link Expander & Decrypter

Quote from their site (with the Grammar fixed!):

“This tool is an Ajax based link expander. It works by taking into account the API & shortening algorithm used by the shortener. After you submit your link, it checks the API used by the shortener. Within seconds the tool unshortens the URL according to the API detected. But that’s not all this tool does, it also tells if the uncovered site is safe to browse and displays a screenshot of the website along with the result. Now you can decrypt any URL with our link unshortener. We have tested our tool with all the services & it works perfectly!”
“Now expand URL from Bitly, Goog.l, AdFly & many more in just a click!”

Performance Boost with VeraCrypt?!

VeraCrypt – Free Open Source Storage Device Encryption
(with strong security for the paranoid!) – Their words, not mine lol.

Has anyone else noticed a performance boost in reading from and writing to a VeraCrypt encrypted storage device?

Let’s run some tests and see if there really is any difference..

Continue reading “Performance Boost with VeraCrypt?!”

Recommended free storage device benchmarking software for Windows 10

For free storage device benchmarking software, I highly recommend CrystalDiskMark. The interface is nice, clean, and simple to use. And the results are easy to understand!

You can even record the test results by pressing Alt-PrintScreen (after the benchmarks have completed, of course) to post to your website or blog for sharing and historical comparisons.

I’ll be using this program in my next blog post to test VeraCrypt’s (a free storage device encryption program) performance vs the same plain hard drive.

estimation

Recommended drive diagnostic software for Windows 10 (with S.M.A.R.T. data!)

For free hard, flash, USB, SSD, and NVMe drive diagnostic software, I highly recommend¬†CrystalDiskInfo. It sits in your Windows system tray and report all drive’s temperatures and S.M.A.R.T data.

It can also set off an audible alarm if any drive’s temperature gets too high (the temperature limit is adjustable). Very useful when testing new computer case configurations or new drives!