Questions tagged [debugging]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
20 votes
2 answers
23k views

How do I determine why a MongoDB document is failing validation?

How do I determine why a MongoDB document insert is failing validation? All I get back is a writeError that says "Document failed validation", which isn't very helpful. (This happens often, and I'd ...
Jonathan Wheeler's user avatar
16 votes
1 answer
5k views

How do I find out *why* a user has certain effective permissions?

I know that I can query effective permissions by using sys.fn_my_permissions: USE myDatabase; SELECT * FROM fn_my_permissions('dbo.myTable', 'OBJECT') entity_name | subentity_name | ...
Heinzi's user avatar
  • 3,145
11 votes
1 answer
2k views

Surprising results for data types with type modifier

While discussing a recursive CTE solution for this question: Get the last 5 distinct values for each ID @ypercube stumbled across a surprising exception, which lead us to investigate the handling of ...
Erwin Brandstetter's user avatar
7 votes
2 answers
16k views

How to debug deadlocks in SQL Server 2008 R2?

I'm using SQL Server 2008 R2 that automatically lock database items based on my queries. Sometimes this deadlocks - two threads with different queries never ends. Is there any way to debug how SQL ...
grigoryvp's user avatar
  • 173
7 votes
1 answer
9k views

SQL Server: Failed to start debugger - Data is Null

I'm a developer working on a web application using an instance of SQL Server 2014. I use Visual Studio 2010 sp1 for development. For a task I'm currently working on, I'd like to use the SQL Server ...
Garrett Bates's user avatar
6 votes
1 answer
3k views

Failed to start TSQL debugger

I want to debug in TSQL.When I start the debug the following message box popup. In SSMS v17.2 Then I see this message: In Microsoft Visual Studio 2015 Server Explorer same Error: Then I see this ...
József Kökény's user avatar
6 votes
4 answers
11k views

SQL Server Debugger Permissions without Granting sysadmin to Devs

BOL documentation says sysadmin permission is required to run debugger. I'm 90% certain there is no workaround to this requirement, but thought I would ask just in case someone found a way to grant ...
GWR's user avatar
  • 2,807
5 votes
2 answers
10k views

How to Log Debug Information About a Stored Procedure

We have a group of fairly complex stored procedures that process a transaction queue on a round the clock schedule. These scripts use a number of print statements to document what is being done to aid ...
Caynadian's user avatar
  • 255
5 votes
1 answer
11k views

Remote Debugging

I'm having an issue with remote debugging. I have a non-domain server and a non-domain client PC. The client PC can successfully connect to the server and the instance, and it even runs SSMS as the ...
Thomas Stringer's user avatar
5 votes
1 answer
445 views

How to change default port for T-SQL Debugger

The default port for T-SQL Debugger is 135, it is possible to change this port ? In my company this port is on special list of banned ports, therefore we need to open that service on another port ...
Muflix's user avatar
  • 1,099
4 votes
2 answers
13k views

Why are breakpoints not being hit in SQL Server Management Studio?

SQL Server Management Studio allows debugging of SQL (breakpoints and stepping through the SQL). It is possible to step in to a stored proc being called and to see a call stack. However I cannot ...
redcalx's user avatar
  • 383
4 votes
1 answer
3k views

What PL/pgSQL debugger can I use?

I'm building a lot of PL/pgSQL functions and a debugger would really come in handy because RAISE NOTICE is not enough. I read about a pgAdmin plugin you can install but it was only on Windows and I'm ...
oxfist's user avatar
  • 361
4 votes
2 answers
8k views

Where to look for possible deadlock causes?

We've been having several problems the past days in our production environment, and some of them seem to boil down to database issues. Just realized we are having deadlocks (68 actually), on database ...
Gonzalo Vasquez's user avatar
4 votes
1 answer
4k views

Why is the "The package can not be saved to the file system since its protection level is server storage" error?

When I execute dtutil /sourceserver localhost /SQL "\Maintenance Plans\MaintenancePlan_daily" /copy file;.\MaintenancePlan_daily.dtsx from the answer to my question "Any way to import-export-...
Fulproof's user avatar
  • 1,382
3 votes
2 answers
1k views

Display line number where error occurred in DB2 stored procedure

I have added an EXIT handler in my procedure that captures the SQLSTATE and SQLCODE, and even found a way to get the procedure name, but I also need to know where the error occurred. Suggestions ...
Jake v1's user avatar
  • 73
3 votes
1 answer
1k views

PostgreSQL: Log statements which do sequential scans

I use this snippet to detect missing indexes: https://stackoverflow.com/a/12818168/633961 Example: SELECT relname AS TableName, to_char(seq_scan, ...
guettli's user avatar
  • 1,521
3 votes
1 answer
312 views

A workaround for restoring HierarchyId in SQL server 2014

After installing VS 2015 CTP 4, HierarchyID stopped working in SQL Server 2014. This is the bug listed here. I am looking for a workaround. To that end, I have tried reinstalling everything associated ...
soandos's user avatar
  • 157
3 votes
1 answer
802 views

Is there an effective way to create extended event data that includes stacktraces in SQL Server on a local db instance?

I read Paul Randal's article on getting the symbols for SQL Server. I have a theory that I could get the extended events to read the symbols from the symbol server catch directory by setting the ...
Justin Dearing's user avatar
2 votes
2 answers
3k views

How to configure data collection in SQL Server 2012?

In SSMS of SQL Server 2012 Enterprise on Windows Server R2 Standard, each time I am trying to set sub-option "On demand" of option "Non-cached - Collect and upload data on the same schedule" of Data ...
Fulproof's user avatar
  • 1,382
2 votes
1 answer
3k views

Getting conversion error, for value that doesnt exist in database [closed]

I am running this query: SELECT thirdpid , ea.Empid , ea.Empname , em.RsCode , em.CustomerName AS 'RS Name' , SUM(CASE WHEN ea.Present=1 THEN 1 ELSE 0 END) AS 'Present days' ...
theTuxRacer's user avatar
2 votes
1 answer
905 views

Tracing the origin of noTimeout cursors

I'm currently managing a Mongo DB instance that has several applications using it. It's been accumulating noTimeout cursors, and, while it's easy enough to cull them if they start getting overwhelming,...
Mike Precup's user avatar
2 votes
1 answer
6k views

strategy for enabling a general query log on MySQL 5.0.95 with no restart?

I would like to configure a general query log for a busy MySQL 5.0.95 production server without effecting the availability. Obviously I can set the "log" option in the my.cnf file and restart the ...
Tom's user avatar
  • 267
2 votes
1 answer
157 views

Is it ok for MySQL to always use 18-25% of Memory (I have 2 GB Ram)?

I have MySQL 8 in my Server with Ram of 2GB. And MySQL is always using 18-25% of Ram even when everything is off. Is it normal? If not then plz let me know how to debug it.
Xinecraft's user avatar
2 votes
1 answer
215 views

Why is an Oracle Package Variable Intermittently Incorrect after Multiple Updates

I am supporting an application that runs on Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production. We have a table that stores hourly data that uses triggers call a package to ...
Vulcronos's user avatar
2 votes
1 answer
637 views

mariadb (mysql) innodb not optimizing SELECT for partitions?

I have a table partitioned by on column "level" -- I have logs where level 7 is the verbose info, which is like 20x as many entries as all the other levels. When purging old logs in level 7, it was ...
user1278519's user avatar
2 votes
1 answer
110 views

False positive error message in MS Access (concurrent users)

I have discovered a strange apparent bug in MS Access and would like to know if others know it already and hopefully how to get around it. Trying to count records based on known column categories. ...
Michael's user avatar
  • 21
2 votes
1 answer
367 views

Has anyone ran into this replication breaking bug before?

I've been having this issue where replication was breaking on colliding primary keys. The annoying thing was these were auto increment generated. I think my issues been tracked down to http://bugs....
atxdba's user avatar
  • 5,273
2 votes
0 answers
136 views

How to get the name of a variable instead of its value in plpgsql?

I write a lot of debugging code in plpgsql along the lines: RAISE NOTICE 'var1 = %', var1; (there can be more than one variable to print out). Is it possible to avoid having to repeat the variable ...
tinlyx's user avatar
  • 3,540
2 votes
0 answers
566 views

Include stored procedure text output in the maintenance plan log

I have a maintenance plan subtask in SQL Server 2012 Enterprise that executes a stored procedure (or a SQL Server agent job). In the log file for this maintenance plan, there are a few lines for this ...
HugoRune's user avatar
  • 361
2 votes
0 answers
114 views

SQL Server - Debugging - How to show parametervalues as HEX

I am writing a script which sets Parameters in the Registry for SQL Server. The following works on some of my servers but not all. DECLARE @Parameters AS VARCHAR(MAX) SET @Parameters = '-T1118' ...
Bengelnatz's user avatar
2 votes
0 answers
3k views

MySQL: Writing log entries from stored procedure

Is there a standard way to write log messages in MySQL stored procedures? I can write log messages to a designated log table, but I prefer the standard log mechanism where each message is coupled ...
Adam Matan's user avatar
  • 11.7k
1 vote
2 answers
7k views

Is it possible in Oracle to trace SQL statements that result in errors?

We have Oracle 11g in production. Application system is still under active development. It will be very handy to get SQL statements which cause any error. Does Oracle provide a standard function to ...
evg345's user avatar
  • 173
1 vote
3 answers
1k views

How to make SQL Server Agent job history less verbose?

So, I've created a SQL Server Agent job, according to the answer to my prev question: running nightly (at 2:11) according to the schedule: There are 9 .bak files in 3 subdirectory of d:\backup\ ...
Gennady Vanin Геннадий Ванин's user avatar
1 vote
2 answers
396 views

Get the Text of the currently running SQL?

This is something I am just interested in knowing if it is possible. Could I write an SQL query that could return the text of itself as a variable? Where I might use this would be on things like ...
user802599's user avatar
1 vote
2 answers
87 views

Can I find errors without using testing data for all the branches of each function?

In PostgreSQL, syntax errors (except for trivial syntax errors) are reported while running the code in question; unlike Oracle, PostgreSQL can't find errors without running the part of the code. This ...
Pavel V.'s user avatar
  • 747
1 vote
1 answer
5k views

Why I cannot let EXPLAIN update statements?

I can imagine that it's actually more important to explain SELECT statements, but I wonder why there's no possibility to use EXPLAIN on UPDATEs/INSERTs. I may use a WHERE-statement in an UPDATE where ...
32bitfloat's user avatar
1 vote
4 answers
142 views

Investigating an Oracle 12c outage after the fact, while limited to SQL*Plus

Warning up front: unfortunately I'm limited to using SQL*Plus on remote site, with no other tools available. This is Oracle 12c (12.2.0.1.0) Standard Edition running on Windows Server 2012R2. Over ...
TrojanName's user avatar
1 vote
1 answer
8k views

Mysterious postgres process pegging CPU at 100%; no running queries

I have a recurring issue where a postgres process is pegging my cpu at > 100%. It's a strange one, you can see below the command is ./Ac2p20853 (surrounded by asterisks, added by me). Running SELECT ...
46and2's user avatar
  • 111
1 vote
1 answer
333 views

HSQL DB grows large and is full of zeroes

I have an application whose HSQL database grows awfully large for some users, but not others. When I received one example where this problem happenned, I discovered that the database is nearly empty - ...
JohnEye's user avatar
  • 173
1 vote
1 answer
892 views

MongoDB Implicit And

I'm trying to understand mongodb queries, but one of my queries is returning a record that it shouldn't. I am trying to call db.user.find({'referral.money':{'$ne':0, '$ne':null}}) to get all users ...
jakedipity's user avatar
1 vote
2 answers
2k views

How to set default schema for PostgreSQL debugger?

I have 3 schemas: public, meta, data. While debugging large function from "data" schema in PgAdmin III or SQL Manager for PostgreSQL, debuggers doesn't see any tables or functions from the same ...
Ice2burn's user avatar
  • 115
1 vote
1 answer
411 views

debugging an ssis package which is invoked from a .net application?

can we attach a debugger to an SSIS package which is invoked to execute from a .net assembly?
deostroll's user avatar
  • 189
1 vote
1 answer
238 views

Problem with case statement and dynamic table name

I have the following case statement case %1$s::text when ''lookup_relation_job'' then case %1$s.relation when ''followers'' then ''get-followers'' when ''following'' then ''get-...
Sumit Ghosh's user avatar
1 vote
1 answer
2k views

Identify mysqldump activity in MySQL log file?

I have a database that is being regularly backed up by mysqldump by... something. It's not a script that I wrote, not sure whose it is. I'm trying to find out more about these dumps, such as what ...
FrustratedWithFormsDesigner's user avatar
1 vote
1 answer
764 views

MySQL MyISAM index causes query to match no rows; indexes disabled, rows match

I created a table and index as described in this SE post, but when I query the table for a particular ID, no matches are found. When I disable the index, matches are found. Commands ran: CREATE ...
Dolan Antenucci's user avatar
1 vote
1 answer
1k views

High MySQL CPU usage, queries seem fine, not running ntp

I've had about 48 hours of extremely high CPU usage on my main MySQL database for no apparent reason. I realize this question is quite similar to the one posed here: High CPU usage from MySQL with no ...
Mikel's user avatar
  • 111
1 vote
2 answers
2k views

IN clause not working on mysql 8.0.17 [closed]

I was on mysql:8.0.15 and I updated to mysql:8.0.17 On 8.0.15 ... and (col1, col2) in (('a', 'b')) the query return results, this is what I expect On 8.0.17 the same query with same data return 0 ...
user3803241's user avatar
1 vote
1 answer
919 views

Duplicate rows with primary key constraint in PostgreSQL 10.6

I have a table that's had CONSTRAINT table_pkey PRIMARY KEY (id) since setup. However, I recently found that I have around 100 duplicate rows (I ran select count(*) from (select count(*) from table ...
mckennab's user avatar
  • 111
1 vote
0 answers
2k views

Dynamic SQL Stored Procedure called by a Function

I want to be able to dynamically call a function that contains a select statement whose table changes depending on the function parameters. I know this is not possible to do within a function, but I ...
WXMan's user avatar
  • 111
1 vote
2 answers
188 views

Object Reference Not Set ... Debugging Stored Procedure in Visual Studio

I'm working on updating a stored procedure that is called to update a user. This stored procedure needs to also create a description of what was updated for auditing purposes. However when debugging ...
John M.'s user avatar
  • 111