Tuesday, August 29, 2017

Why can I not use SQLPS to run this?

Here's the scenario:

I have a script, loaded into C:\temp\checkps.ps1, on a remote dev SQL Server, whose execution policy has been set to unrestricted. (Because you wouldn't allow that on a Prod server, would you?)

Let's say that file has the following body:

 Import-Module Sqlps -DisableNameChecking  
 Get-Module -ListAvailable -Name Sqlps  

(Incidentally, that's from this MS docs page)

I want to execute something like this in SSMS:

 Exec xp_cmdshell 'powershell.exe -file c:\temp\checkps.ps1 -ExecutionPolicy Unrestricted'  

And instead, I got this error:

invoke-sqlcmd is not recognized in windows powershell
The term 'invoke-sqlcmd' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Import-Module : The specified module 'Sqlps' was not loaded because no valid

"Import-Module : The specified module 'SQLPS' was not loaded because no valid module file was found in any module directory."
also, got this

Invoke-Sqlcmd : The term 'Invoke-Sqlcmd' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1


So, I wound up having to do three things.

First, I downloaded and ran the Powershell extensions installer on the server itself.

Second, to copy the SQLPS module directory from where it was, to here:

C:\Windows\system32\WindowsPowerShell\v1.0\Modules

Note that I first had to get the location of SQLPS, as in running this in poweshell:

$env:PSModulePath


Third, I had to grant the service account full control of the script location through Windows right click menu (Properties >> Security >> Add >> Add user account >> Full Control )











Tuesday, August 15, 2017

Why use Enron data, anyway?

From Wikipedia's article on the same:

The Enron Corpus is a large database of over 600,000 emails generated by 158 employees[1] of the Enron Corporation and acquired by the Federal Energy Regulatory Commission during its investigation after the company's collapse.[2]

This makes it ideal, because:

  • It's public
  • It's relational
  • It's relatively numerous rows, but still sits inside a 60 GB VM


(Another really good candidate, if you have the VM / hard drive space is the Stack Overflow data set)

Tuesday, August 8, 2017

How does one get Enron data?

For upcoming samples, I'm going to be using Enron data.

Some places to find this information:

https://www.cs.cmu.edu/~./enron/

Others:

https://www.opensciencedatacloud.org/publicdata/enron-emails/

https://www.kaggle.com/wcukierski/enron-email-dataset


Tuesday, August 1, 2017

Death of retail due to the cloud, so to speak


This seems insane to me - Payless is going to close 1,000 stores.

http://www.msn.com/en-us/money/companies/these-haunting-photos-of-the-retail-apocalypse-reveal-a-new-normal-in-america/




There's a lot of ink spilled on the impact of "the cloud" to the DBA, but ultimately, if you knew what motivates people to buy shoes, one hopes that one could find a job using that knowledge as either a transferable skill or a direct application, such as marketing director for a shoe company.

I would suggest this is that same pattern that has always been - if you're good at something with a business application and committed to lifelong learning and growth, one industry (retail) declining just means the growth and opportunities have a new name, not that they've gone away.