1

I have this Stored procedure on my sql server :

[InsertRecord] @param1 varchar(10), @Param2 varchar(50),@Param3 varchar(10)=NULL, 

@Param4 datetime = NULL AS BEGIN  

When I update it with the following code :

   connenction = pymssql.connect (host=host1,user=user1,password=password1,database=database1)
  curser = connection.cursor() 

  my_query="exec InsertRecord '%s','%s','%s','%s'" %(var1,var2,var3,var4)
  print my_query
  cur.execute(my_query)

I didn't get any sentax error and the stored procedure not updated on my DB

but when i run the my_query string from the sql managment studio the query ran as it should be . could someone provide what could be the problem with this code and how should i run this stored procedure with pymssql.

1 Answer 1

3

As your fiance said - you have commitment issues!

connection.commit()

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.