Most Popular

1500 questions
85
votes
2 answers

How to add the Debug button to SSMS v18?

The Debug button is present on this version of SSMS: But it is not present on version 18, preview 4: I have tried in several ways to add the Debug button to my SSMS but not successful. Is there a way to add the Debug button to SSMS v18?
Marcello Miorelli
  • 16,170
  • 52
  • 163
  • 300
85
votes
4 answers

Mongodump: Unrecognized field 'snapshot'

I am using mongodump from mongo tools to download a backup of my server. However as I run the command, the command returns "Unrecognized field 'snapshot'". The full error is: Failed: error reading collection: Failed to parse: { find: "data", skip:…
Dave
  • 1,023
  • 2
  • 9
  • 8
83
votes
4 answers

PostgreSQL: Remove password requirement for user postgres

I understand that, upon installation, PostgreSQL has no password for its db root user (postgres): postgres=# select usename, passwd is null from pg_shadow; usename | ?column? ----------+---------- postgres | t (1 row) ... and one is advised to…
Marcus Junius Brutus
  • 3,309
  • 7
  • 29
  • 44
83
votes
6 answers

How to select the first row of each group?

I have a table like this: ID | Val | Kind ---------------------- 1 | 1337 | 2 2 | 1337 | 1 3 | 3 | 4 4 | 3 | 4 I want to make a SELECT that will return just the first row for each Val, ordering by Kind. Sample…
BrunoLM
  • 3,473
  • 7
  • 27
  • 22
83
votes
4 answers

Check constraint only one of three columns is non-null

I have a (SQL Server) table that contains 3 types of results: FLOAT, NVARCHAR(30), or DATETIME (3 separate columns). I want to ensure that for any given row, only one column has a result and the other columns are NULL. What is the simplest check…
David Clarke
  • 1,197
  • 2
  • 10
  • 17
83
votes
8 answers

MySQL Error Reading Communication Packets

In MySQL error logs, I see these quite few a warnings like these: 120611 16:12:30 [Warning] Aborted connection 2619503 to db: 'db_name' user: 'user_name' host: 'webapp_hostname' (Got an error reading communication packets) Haven't noticed any loss…
KM.
  • 1,357
  • 4
  • 14
  • 20
82
votes
6 answers

What is the best way to store an email address in PostgreSQL?

What would be the right datatype to store email addresses in PostgreSQL? I can use varchar (or even text), but I wonder if there is a more specific data type for emails.
Adam Matan
  • 11,659
  • 29
  • 80
  • 95
82
votes
1 answer

How to force drop database in SQL Server 2008

I'm trying to force drop a database, but after dropping the database, when I try to recreate the database, I'm getting the error cannot create file C:\Program Files.....[databasename].mdf because it already exists Here's my query to force drop…
srk
  • 921
  • 1
  • 6
  • 6
82
votes
10 answers

What are the arguments against or for putting application logic in the database layer?

NOTE The audience of programmers.se and dba.se is different, and will have different viewpoints, so in this instance I think it's valid to duplicate What are the arguments against or for putting application logic in the database layer? on…
Phil Lello
  • 1,469
  • 1
  • 11
  • 9
81
votes
2 answers

How to join a table with a table valued function?

I have a user defined function: create function ut_FooFunc(@fooID bigint, @anotherParam tinyint) returns @tbl Table (Field1 int, Field2 varchar(100)) as begin -- blah blah end Now I want to join this on another table, like so: select f.ID,…
Shaul Behr
  • 2,933
  • 8
  • 32
  • 41
81
votes
5 answers

Are SQL Server in-place upgrades as ill advised as they used to be?

I have been working with SQL server on and off since SQL Server 6.5, the old advice that still rings in my head was never to do an in-place upgrade. I'm currently upgrading my 2008 R2 DEV and TEST systems to SQL Server 2012 and need to use the same…
DamagedGoods
  • 2,591
  • 6
  • 33
  • 48
81
votes
7 answers

How do I completely disable MySQL replication

I am running dual master MySQL replication and now want to move to a single database with no replication. How do I completely disable replication on both databases?
David Collie
81
votes
4 answers

How to identify which query is filling up the tempdb transaction log?

I would like to know how to identify the exact query or stored proc which is actually filling up the transactional log of TEMPDB database.
prasanth
  • 1,033
  • 2
  • 9
  • 12
80
votes
5 answers

What risks are there if we enable read committed snapshot in sql-server?

I have read here that some extra data will be stored per row so we might see a performance degradation but what other risks are there? eg. Will this affect recovery of the database? Is there anything else we need to do to take advantage of this? I…
Adam Butler
  • 1,531
  • 4
  • 16
  • 16
80
votes
2 answers

Understanding "bitmap heap scan" and "bitmap index scan"

I'll try to explain my misunderstandings by the following example. I didn't understand fundamentals of the Bitmap Heap Scan Node. Consider the query SELECT customerid, username FROM customers WHERE customerid < 1000 AND username <'user100'; the…
St.Antario
  • 1,205
  • 1
  • 10
  • 15