Tuesday, 7 January 2020

Run Python with T-SQL on SSMS

1. Run the following commands in SSMS:
    sp_configure 'external scripts enabled'
    GO
    sp_configure 'external scripts enabled', 1;
    GO
    RECONFIGURE;
    GO
    sp_configure 'external scripts enabled'
    GO

2. Restart the SQL Server Service

3. Run the following command in SSMS:
    sp_configure 'external scripts enabled'
    GO

4. Test the code:
    EXEC sp_execute_external_script
    @language = N'Python',
    @script = N'print(''Hello Python !!! from T-SQL'')'

More...

No comments:

SQL: Generate a range of numbers

SELECT ones.n + 10*tens.n + 100*hundreds.n + 1000*thousands.n FROM       (VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) ones(n),      (VALU...