139 questions
1
vote
0
answers
98
views
Ignore all printed messages to avoid "No results. Previous SQL was not a query."
I am trying to execute a SQL script on SQL Server in Python using pyodbc and the driver ODBC 18 (Windows OS). The script produces a dataset with some rows in output and, during the execution, it ...
-1
votes
1
answer
500
views
Alerts Not Firing
##CharlieFace answer in the comments fixed my issue.
The alerts are not triggering.
Test 1:
RAISERROR('Test Alert Error', 16,1)
... I don't get any emails .
Test 2:strong text
If I test with this
...
0
votes
1
answer
436
views
Ignore custom RAISERROR in WHILE loop
I have a stored procedure that is executed via a SQL job. I am trying to output my date range for each execution of my WHILE loop to a log file so that the progress can be monitored outside of SQL ...
0
votes
0
answers
61
views
IOError: [Errno 13] file not accessible: '/dev/null'
enter image description here
getting this error for python2.7.18, Google cloud SDK version 412.0.0.0 and app-engine-python: 1.9.101
running localhost:8080
1
vote
0
answers
98
views
Get message of Raiserror SQL or change value of output parameter
Using SQL Server, I'm executing a stored procedure that may sometimes throw a Raiserror and sometimes not. Now I tried to use the returned parameter for tests, but it is not passed
errCount=-1
query=&...
0
votes
1
answer
622
views
How to retrieve @@SPID from running stored procedure called from C# code
I am trying to implement "cancel" functionality on pages with potentially long running select queries or processes. Indexing and other optimizations have been done to minimize this ...
0
votes
0
answers
252
views
How to ignore RAISERROR in Sybase ASE-15 T-SQL?
I have a loop which executes a proc.
That proc can throw RAISERROR which, of course, stops the loop and the whole program.
Is there any way to ignore that error and continue the loop?
In normal ...
0
votes
0
answers
17
views
Can't enter exception after try [duplicate]
I am trying to enter the exception part after the try statement. Here is my code
user_date = user.datetime
try:
user_date == None
print(user_date)
except Exception as e:
...
-1
votes
1
answer
357
views
Avoid newline when using raiserror
Suppose I debug using raiserror, like so:
raiserror('Trying to do something...',0,0) with nowait
(queries that do something)
raiserror('Done.',0,0) with nowait
It would be handy to have this output ...
0
votes
3
answers
605
views
Raise trigger for duplicate prevention
I am trying to raise a trigger if duplicate is being inserted into the table movie_cast$. But the error is not being raised even if duplicate is being inserted. This is the stored procedure and ...
0
votes
1
answer
98
views
SQL - When to use @Variable
I found this piece of code online:
...
END TRY
BEGIN CATCH
DECLARE
@ErMessage NVARCHAR(2048),
@ErSeverity INT,
@ErState INT
SELECT
@ErMessage = ERROR_MESSAGE(),
@ErSeverity = ...
1
vote
1
answer
299
views
SQL Server @@error not working. Doesn't go into "if"
I wrote a very simple procedure. I am deliberately making a mistake in the procedure. but the error is not working. I want to return the error I want with raiserror. but it doesn't even go inside the &...
0
votes
1
answer
529
views
Accessing the name of a variable/argument
I'm writing a function in Python to compute some stuff, and if the argument to my function is not of the right type, it fails miserably. So I want to raise an error when that happens.
def do_stuff(x):
...
0
votes
1
answer
2k
views
Raise ValueError not getting through unit test
I am trying the unitest to raise the value error when the value is negative using the code below.
A raise error is added : number should be greater than 0 But when I run the code below:
from functools ...
0
votes
0
answers
168
views
in T-SQL which error severity level, if any, lets the statement continue but causes SqlClient library to display a message
I am not clear about T-SQL error severity levels as they relate to the System.Data.SqlClient library in .NET client applications. [bolded for emphasis in response to close-vote suggestion that I ...