How to configure SQL Server Machine Learning Services on Mac? - sql-server

I'm trying to run Python within SQL Server using Machine Learning Services, however, I am having a really hard time getting started. I have SQL Server 2019 running/set up on Mac using Docker according to this video.
What I've tried to get Machine Learning Services working:
Installing the Machine Learning extension for Azure Data Studio, including following listed prerequisites:
-Specifying the local path to a preexisting Python installation under Settings
-Microsoft ODBC driver 17 for SQL Server for macOS
Running the script (which runs successfully):
EXEC sp_configure 'external scripts enabled', 1
RECONFIGURE WITH OVERRIDE
After running the above script: disconnecting from the server, quitting Azure Data Studio, and either stopping or restarting the container
However, whenever I attempt to run a piece of code like this:
EXEC sp_execute_external_script
#language = N'Python',
#script=N'print("Hello World!")'
GO
I keep receiving the error:
Msg 39111, Level 16, State 1, Procedure sp_execute_external_script, Line 1
The SQL Server Machine Learning Services End-User License Agreement (EULA) has not been accepted.
I've followed other solutions, though all seem to be Windows oriented, such as restarting SQL Server services or Launchpad via Configuration Manager. Any help is much appreciated, thank you.

Related

Azure Data Studio (ADS) Machine Learning Services (SQL Server 2019)

We are building a ML solution using SQL Server Machine Learning services. We understand that you can invoke the SQL instance Python via commands like this.
EXECUTE sp_execute_external_script #language = N'Python', #script = N'
a = 1
b = 2
c = a/b
d = a*b
print(c, d)
'
The above commands will run in the SQL Server. However, this is not ideal for a development scenario. The idea is that we develop via Azure Data Studio and finally copy and pasta the codes via the sp_execute_external_script. However, we are facing an issue here.
In SQL Server, the Python environment comes from here:
C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\PYTHON_SERVICES
while I am not able to launch an Azure Data Studio's Python kernel from here. I tried changing the kernel using this link.
https://learn.microsoft.com/en-us/sql/azure-data-studio/notebooks/notebooks-python-kernel?view=sql-server-ver16
enter image description here
However, I am not able to launch the Python kernel after this. Essentially, I am not able to use an existing installation of python.

Cannot find analysis services in my sql server configuration manager

I have installed SQL Server management studio and have been using it for a little while, but now I decided to connect to the analysis services, it has been showing me a server not running error. I went ahead to check configuration manager according to some online solutions but i cant find any installation of the analysis services.
Cannot connect to (local).
ADDITIONAL INFORMATION:
A connection cannot be made. Ensure that the server is running.
(Microsoft.AnalysisServices.AdomdClient)
No connection could be made because the target machine actively
refused it 127.0.0.1:2383 (System)
Don. It seems to be a service version problem. Are versions of console and service the same?
Here you can find a nice example of using SQL server Discovery report How can I determine installed SQL Server instances and their versions?
Use the latest version of the installation disc.

SQL Server windows NT

I have 3 SQL Server Windows NT processes running and they consume the resources, I read that they are instances and if I'm not using some of them I should remove them, but I'm new to SQL Server and I don't know which instance I'm using.
How can I find out which instance I'm working on? and would deleting the folders in program files be enough cause I can't find them in apps & features?
SELECT ##servername will give you server/instanceName
Server: Is your sever name (Your machine name)
InstanceName: is the instance installed
After you know which instance you are using (MSSQLSERVER in your case) follow this article to uninstall other instances.
You can get the process id from the windows task manager, and search it in the SQL Server logs. Follow this Step by step article for more information.
Also you can benefit from the sp_Who2 and sp_who procedures:
From SQL management studio run EXEC sp_Who, and you will find the process that are using the instance.

xp_cmdshell on SQL Server Linux Public Preview

I am using the Public Preview of SQL Server 2016 on Linux.
I am trying to run xp_cmdshell and get the following error.
I suspect it has to do with permissions but have no idea how to fix this.
I have spent many hours searching for some answers but there seems to be little support for SQL Server on Linux.
I am running this using an administrator account.
SQL Server is installed on Ubuntu 16.4 (as recommended).
I connect to it with Microsoft SQL Management Studio running on Windows 10.
SQL code:
EXEC xp_cmdshell #SQLtext, no_output
Error message:
Msg 15121, Level 16, State 21, Procedure xp_cmdshell, Line 1 [Batch
Start Line 159] An error occurred during the execution of xp_cmdshell.
A call to 'CreateProcess' failed with error code: '2'.
According to Microsoft's Release Notes for SQL Server 2017 General Availability, the following are currently not available on Linux:
Database engine
Transactional replication
Merge replication
Stretch DB
Polybase
Distributed query with 3rd-party connections
System extended stored procedures (XP_CMDSHELL, etc.)
Filetable
CLR assemblies with the EXTERNAL_ACCESS or UNSAFE permission set
Buffer Pool Extension
SQL Server Agent
Subsystems: CmdExec, PowerShell, Queue Reader, SSIS, SSAS, SSRS
Alerts
Log Reader Agent
Change Data Capture
Managed Backup
High Availability
Database mirroring
Security
Extensible Key Management
AD Authentication for Linked Servers
AD Authenticatin for Availibility Groups (AGs)
Services
SQL Server Browser
SQL Server R services
StreamInsight
Analysis Services
Reporting Services
Data Quality Services
Master Data Services
Microsoft also has a list of Release notes and a list of unsupported features here.

Connect to localdb with sql-cli

There is the sql-cli utlity (installed with npm) which I am using to connect to various SQL Server machines. It works perfectly, however when connecting to localdb it responds with an error. So the next command line works:
mssql -s SomeServerAddress
But this one doesnt work:
mssql -s (localdb)\v11.0
And it responds with
\v11.0 was unexpected at this time.
Is there any special formatting for the server name to work?
Thanks.
its because (localdb)\v11.0 is not an actual instance as it can only be used inside visual studio.
"The localdb is at the heart of SSDT; it’s similar to SQL Server Express under the hood and runs a full version of sqlserver.exe. However this is throttled by the numbers of CPUs and limits on resources. There are quite a lot of limitations; you cannot upgrade the instance and there is no management and the sqlserver.exe does not run as a service. It is not similar to SQL Server Compact as this is feature-less (no stored procedures or functions) it is actually a DLL file that runs in a process from within Visual Studio, but is not available to task manager or windows. It is awakened when the SQL Server Native Client requests a connection from within Visual Studio. It doesn't stay online forever, it shuts down after time. You can configure where it creates the SQL files required to run. The localdb does not support table partitioning or data compression at the moment. However there are not many features that it does not support. You can however configure SSDT to use a full version of SQL Server i.e. the Developer edition, if your project requires unsupported features; by changing the Debug Connections tring in the projects properies." - Andrew J Fenna
This works:
mssql-cli -E -S (localdb)\mssqllocaldb
The -E is for integrated auth, the -S is the server.
If it does not connect, try to start localdb:
sqllocaldb start mssqllocaldb
This is all that is needed. No need to start Visual Studio or any other tool.
You may alreaady have gone on to bigger and better things, but
mssql -s "(localdb)\MSSQLLocalDB"
has worked for me.
Regards

Resources