반응형

/*******************************************************************************************************************
-- Title : [MSPy] SQL Server ML Services w/ Python 환경 세팅
-- Reference : docs.microsoft.com
-- Key word : instance features machine learning services python sp_execute_external_script                   sp_configure external script enabled 메시지 39011 Message 39011 microsoftml
                  sql server machine learning services with python
*******************************************************************************************************************/

■ SQL Server 설치 시 Python Feature 설정


■ Python 설치 경로 확인
    -- C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\PYTHON_SERVICES


■ 환경 세팅
    - http://dbrang.tistory.com/1080
    - Microsoft R Services와 환경 동일
    - 필요시 환경 변수 설정(dbrang.tistory.com/624)

■ Python 버전
    - Python 3.5.2 :: Continuum Analytics, Inc.

■ SQL Server Launchpad 시작
    - SQL Server 구성관리자 오픈(sqlservermanager14.msc 실행)
    - SQL Server Launchpad 실행
    - "
메시지 39011, 수준 16, 상태 1, 줄 1
       SQL Server가 실행 패드 서비스와 통신할 수 없습니다. 서비스 구성을 확인하세요. "


■ SQL

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-- https://docs.microsoft.com/ko-kr/sql/advanced-analytics/python/setup-python-machine-learning-services
-- http://dbrang.tistory.com/1080
 
 
-- 외부 스크립트 기능 허용
EXEC sp_configure  'external scripts enabled'1
RECONFIGURE WITH OVERRIDE
 
 
-- Servce Restart
-- run_value = 1 확인
EXEC sp_configure  'external scripts enabled'
 
-- Test Scripts
EXEC sp_execute_external_script 
     @language =N'Python'
   , @script=N'OutputDataSet = InputDataSet'
   , @input_data_1 = N'SELECT 1 as col_nm'
cs


■ SQL Server Python 동작 원리

반응형

+ Recent posts