user274610
user274610

Reputation: 529

Passing a string to a stored procedure from Python produces an error

I don't understand why I get the following results. My SQLServer 2017 MSSC looks like:

enter image description here

Why am I getting: NameError: name 'pr' is not defined?

Charles

Upvotes: 0

Views: 93

Answers (1)

Martin Smith
Martin Smith

Reputation: 453707

You have

DECLARE @my_script nvarchar(100)

This isn't long enough and your python gets truncated to the following

foo = "Hello " + "world"
print("foo1: ", foo)

foo = "" + "world"
print("foo2: ", foo)

pr

You should increase nvarchar(100) to a higher amount.

Upvotes: 1

Related Questions