The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
37 views

RaiseError in Try block [closed]

Is there anyway that I can raise error from try block and avoid the catch block? For example: In this case, the catch blows the exception - I don't want it to happen and I need the RAISEERROR to be ...
1
vote
1answer
54 views

Possible to use a Trigger as failsafe for insert in two databases?

(This is for a project on MSSQL 2008R2 Server) I have been tasked with splitting a table into an internal (same db as before) and an external one (different server). Currently the idea is to read ...
2
votes
1answer
23 views

Tracing 'Invalid Number Error' from millions of rows using a large, complicated query

Background I am working on fixing a large query that I inherited. The query consists of over 200 lines of DML statements. The search queries the database restricting the data to a single month. Most ...
0
votes
1answer
208 views

Error 1236 From Master After Restored Replication

I've been trying to restore a broken replication caused by power interruption. upon checking the slaveDB, it was already broken so I setup a new replication. And upon supposedly completing the ...
1
vote
1answer
1k views

Override/kill when Code 3/SQLSTATE=57016 Occurs

I have encountered issues a few times when a process of mine performs a bulk load to a temp table we use for pre-processing purposes. The Bulk load fails for one reason or another (this we are looking ...
2
votes
2answers
5k views

How to break SQL script execution

I am working on sql script and I am having a requirement of stop continuing the script if some conditions are not satisfied. When I Google it, I found the RaisError with 20 severity level will ...
2
votes
1answer
313 views

Moving away from CmdExec steps in job without losing logging detail (SQL Server 2008)

My department currently relies heavily on CmdExec steps in SQL Server Jobs, called using a SQL Server Login. For example osql /e /n /S SERVER01 /U USER /P PA$$$ /d DATABASE_01 /i ...
1
vote
1answer
89 views

Oracle error handling strategy [duplicate]

I am developing a project using oracle. I am writing functions and stored procedures to handle CRUD statements. My question is in addition to oracle check constraints do I have to check error ...
2
votes
3answers
655 views

Backups script completes, but doesn't back up all dbs

I'm running sql server 2005 and I've made a simple backup script that backs up all the databases on one server. The script always succeeds, but when I go to check the log or the files, I see it has ...
1
vote
1answer
209 views

How to suppress an informational raiserror message

I have a setup script that calls sp_configure a few times to set up some system variables, it works fine but I have a few of the following statement Configuration option '%ls' changed from %ld to ...
1
vote
2answers
487 views

Long time, sporadic 'String or Binary data would be truncated.' Wisdom would be appreciated

TL;DR How can I diagnose the source of a very inconsistent, un-reproducable 'String or Binary data would be truncated.' error, when I am quite positive the problem isn't related to user data being to ...
2
votes
1answer
1k views

DB2 Server Table Space Locked

At work we keep receiving the following DataException seemingly at random when one of our processes tries to write/access a table for one of our clients: com.ibm.db.DataException: A database manager ...
0
votes
3answers
3k views

What is ERROR_STATE() in SQL Server and how it can be used?

I read that ERROR_STATE() can help to distinguish between different states/locations in the source code where same type of error can occur. But it is not really clear to me that how it can be useful. ...
6
votes
1answer
611 views

Package state not re-intialized on raise_application_error

When a package has state and the header is changed, the first call gets an error stack something like this: ORA-04068: existing state of packages has been discarded ORA-04061: existing state of ...
4
votes
1answer
3k views

Finding exact statement causing error 3930

Lately I've been seeing errors in the SQL Server Log. Code:3930 Description:"The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the ...
4
votes
1answer
452 views

Raising an error with a system message_id in SQLCLR

If call CREATE DATABASE foo twice I get the error message: Msg 1801, Level 16, State 3, Line 1 Database 'dropme' already exists. Choose a different database name. The error message is listed in ...
7
votes
1answer
509 views

CATCH block is triggered when it should not

On my neverending quest for shooting myself in the foot with save transaction I seem to have found even more ways to fulfill the quest purpose. The save transaction clause itself this time is out of ...
7
votes
2answers
2k views

Does Oracle PL/SQL have a standard ASSERT routine?

I'd like to use an ASSERT routine functionally similar to the one found in other languages, i.e. a construct (be it a procedure, syntax...) ASSERT( <condition>, <msg>) such that when ...
2
votes
0answers
140 views

CREATE ASSEMBLY - EXCEPTION_ACCESS_VIOLATION

I am trying to create an assembly on my SQL Server 2005 server. Here is what I am using: CREATE ASSEMBLY [SQLCLRTest] AUTHORIZATION [dbo] FROM 'path\to\my\file.dll' WITH PERMISSION_SET = ...
4
votes
3answers
2k views

Write to Error Log

Using SQL Server 2008 R2: How can I write to the SQL Server Error Log? I have a ROLLBACK statement that I'd like to couple with a statement written to the error log for external monitoring. ...
4
votes
3answers
5k views

How to log error details when using using try/catch for dynamic SQL backup commands

When issuing a backup command within a stored procedure that uses a try catch and dynamic sql, the error messages are very general when compared to running the backup command directly. Try/Catch ...
0
votes
1answer
2k views

How to create custom error messages in APEX?

I would like to replace standard ORA-xxxxx messages with custom ones in Oracle Application Express. For example instead of this: to have something like "You have left some fields blank, try again". ...
2
votes
1answer
2k views

log_warnings doesn't seem to work for aborted connections in MySQL 5.1

The docs for 5.1 say that I can set log_warnings = 2 to capture Aborted_connects in the error log. This bug report suggests that this was only merged into 5.5 and 6.0 (and maybe 5.2) but not into ...
3
votes
1answer
368 views

tds: unable connect to SQL Server using servername specified in freetds.conf file

I am using freetds to connect to SQL Server from ubuntu. First, the SQL Server is running at port 1433 currently. I can telnet it. The following command also works. I can query table data using it, ...
0
votes
1answer
340 views

Which tools can be used to clean CSV files prior to bulk insert?

Which tools and programming libraries are you aware of that can help accelerate CSV manual correction process when column separator characters are encountered within data elements? I'm currently not ...
6
votes
2answers
920 views

Error handling in container procedures

I'm aware of and use the techniques in this question. In my environment we have a lot of container procedures that call subprocedures, that may call other procedures, ad infinitum. For me ...
2
votes
0answers
1k views

ORA-01017: invalid username/password; logon denied

I've come across the abnormal situation, and can't understand what happens. I am connecting databases using PL/SQL Developer 8.0.4.1514(I've also tried v7,but same) . Sometimes(When I am trying to ...
4
votes
1answer
225 views

Odd SQL Server Studio error, but not on SQL Server Express?

I'm running a query that I got today from a previous question, and I just noticed an error that only happens when I run this query ON the server (RDC + MS Studio -- not express) vs on my machine which ...
8
votes
2answers
533 views

Pros and Cons of Checking if value exist for unique column or let db raise unique error on inserting

While writing a query other day a thought came to me and have stuck in my mind. What is preferable, first checking if a value for a unique column exists and then inserting or insert and let db raise ...
2
votes
2answers
866 views

Running a number of .sql files using SQLCMD

I'm trying to put together a batch file to run a large number of .sql files without doing so individually. So far I have: @echo off echo "Enter Server" set /p SERVER= echo "Enter Database" set /p ...
0
votes
2answers
104 views

ORACLE DB ERROR

We are currently experiencing a problem with Oracle DB 8. It is no longer starting and we get this message: ERROR at line 1: ORA-01113: file 19 needs media recovery ORA-01110: data file 19: ...
4
votes
1answer
161 views

how much overhead an error in RDBMS has?

I have a class in my project. On the class I need to do two inner select, to know is there any duplication or not, but I think if I get duplication error and then manage that is better than to select. ...
1
vote
1answer
4k views

Changed database context to 'MyDbName'

I am catching all errors on my Sql Server, I got errors: Changed database context to 'MyDbName'. Changed language setting to us_english. I haven't found any clear explanation of problem and ...
3
votes
1answer
8k views

Why TRY CATCH does not suppress exception in trigger

I have a trigger on a table (source) that data should be copied to the other one (target) in other database. I am trying to implement custom synchronization process for data: I want that target ...
0
votes
1answer
532 views

Make SQL Server Agent retry failed script with Try/Catch

I have a script that has a try catch in it so that if it fails I can roll back the transaction. It runs on a job scheduled through SQL Server Agent. But when it fails SQL Server Agent does not see ...
1
vote
1answer
5k views

Function returning “No data - zero rows fetched, selected, or processed” in MySQL 5.5

I have upgraded MySQL version to 5.5.16 After upgrading, some of the functions are giving warning as No data - zero rows fetched, selected, or processed. In those functions, cursors are there, but ...
3
votes
1answer
4k views

RMAN-06054: media recovery requesting unknown archived log, Where is SCN kept?

I have the following situation: Backups of DB1(located on srv1 server) database are taken everyday at 1:00 AM. I took backed up files(datafile,archivelog,controlfile,spfile) of 24/10/2011 and ...
2
votes
1answer
1k views

ORA-01555: snapshot too old: rollback segment number with name “” too small

This error appears when I am trying to move LOB segment from one tablespace to another one. Also during exporting the same error appears. What can be a problem?
10
votes
1answer
1k views

Generate an exception with a Context

When PostgreSQL throws an exception, there is a line "CONTEXT" like: ERROR: INSERT has more target COLUMNS than expressions LINE 3: ... ...
2
votes
2answers
2k views

Query data from multiple linked remote databases

Using SQL Server 2005 databases and SQL Server Management Studio 2008, I need to query a single value from each of n linked databases at a regular interval. The servers are physically remote and I can ...
3
votes
1answer
7k views

Equivalent functions in MySQL that exist in SQL Server

In an EXIT HANDLER block, what are the MySQL equivalents of OBJECT_SCHEMA_NAME(@@PROCID) + '.' + OBJECT_NAME(@@PROCID) ERROR_MESSAGE() Edit What I want to do. In SQL Server I'd have CREATE PROC ...