Questions tagged [external-scripts]
6 questions
6
votes
1 answer
Why MS SQL bigint type is implicitly mapped to float64 python type, and what is the best way to handle it?
Python integer type has unlimited precision so it is more than capable to hold a bigint value of MS SQL (64 bit). Still it is implicitly mapped to float64 python type, when passed to an external script.
This can cause serious calculation errors for…
atevm
- 337
- 2
- 7
3
votes
2 answers
How do I resolve this python runtime error in Azure SQL Managed Instances?
We recently setup a new managed instance through the program that allows you to try it for free. When trying to run the following code from Microsoft's documentation:
EXECUTE sp_execute_external_script
@language =N'Python',
@script=N'import sys;…
Joe Obbish
- 32,976
- 4
- 74
- 153
3
votes
2 answers
Nest a SQL file into another in SQL Server
I have a simple SQL file I'm using to perform some test:
DECLARE @VAR1 AS VARCHAR(100) = '12345'
DECLARE @VAR2 AS INTEGER = 54321
WAITFOR DELAY '00:00:02'
INSERT Orders SELECT @VAR1 AS COL1, @VAR2 AS COL2, ...
...
Before launching all that,…
Dominique
- 609
- 1
- 7
- 23
3
votes
2 answers
Is using CLR for regular expressions safer than using external scripts?
Problem
The main problem we need to use regular expression on MS SQL Server 2019, with the capability
of at least the level on the POSIX Regular expression.
Possible solutions
This Q/A from stackoverflow rightly concludes that if you query must rely…
atevm
- 337
- 2
- 7
2
votes
0 answers
sp_OACreate script returns Null value from API fetch? The API works well in a html file
I am trying to create a script in Microsoft SQL Server Management Studio to fetch the current exchange rate from an API and update a database. I am told it is not posisble and common to do this.
-- Change the database context
USE lndb;
-- Declare…
Luis Avalos
- 25
- 3
0
votes
0 answers
Parallel execution of a SQL Server external script
TLDR for a reader with the same problem
If your external script is too slow, you may do something in your scritpt which can be implemented in TSQL, which is a big problem. If this is not the case use CLR or process your data in a external…
atevm
- 337
- 2
- 7