Most Popular

1500 questions
30
votes
3 answers

Which PowerShell technique should I use to talk to SQL Server?

I'd ultimately like to use PowerShell to replace the old KornShell scripts we use for SQL instance monitors. I'm having a hard time, though, getting my brain around all the different ways that PowerShell can actually talk to SQL server. Not sure if…
BradC
  • 9,964
  • 8
  • 48
  • 88
30
votes
7 answers

What are the minimum matching criteria recommended for reliable demographic based patient matching?

When matching patients based on demographic data are there any recommendations on what fields should match for the patient to be the "Same Patient"? I know the algorithms will be different for different implementations, I'm just curious if there are…
ScArcher2
30
votes
4 answers

Where can I find the first standardization of SQL, SQL-86?

This question is different but similar to this request looking for SQL-89. The first draft of SQL is labeled SQL-86. Numerous references are made to it. Is this available to download? Wikipedia doesn't even have a page for it. I'm interested in it…
Evan Carroll
  • 63,051
  • 46
  • 242
  • 479
30
votes
4 answers

Do SSDs reduce the usefulness of Databases

I only heard about Robert Martin today, and it seems like he's a notable figure in the software world, so I don't mean for my title to appear as if it's a click bait or me putting words in his mouth, but this is simply how I interpreted what I heard…
Honinbo Shusaku
  • 499
  • 1
  • 6
  • 8
30
votes
8 answers

MariaDB Can't init tc log

I've tried every solution on the Internet but my MariaDb server continue to fail, continue to betray me, continue to destroy my tiny DevOps world. My attempts to smooth the situation included all sorts of satisfaction: changing permissions, configs,…
Sam Ivichuk
  • 365
  • 1
  • 3
  • 7
30
votes
6 answers

Can I rely on reading SQL Server Identity values in order?

TL;DR: The question below boils down to: When inserting a row, is there a window of opportunity between the generation of a new Identity value and the locking of the corresponding row key in the clustered index, where an external observer could see…
Fabian Schmied
  • 575
  • 1
  • 5
  • 10
30
votes
3 answers

Counting rows from a subquery

Simple: I would like to count the number of rows from the sub-query. Note that status is whether the host is online or not. Bad code SELECT COUNT(ip_address) FROM `ports` ( SELECT DISTINCT ip_address FROM `ports` WHERE status IS…
rwcommand
  • 477
  • 2
  • 5
  • 6
30
votes
2 answers

Finding the last time a table was updated

The query: SELECT name AS TableName, create_date AS CreatedDate, modify_date as ModifyDate FROM sys.tables order by ModifyDate; ...will tell me the last time a table was created and modified (from a DDL perspective). But I want to…
dublintech
  • 1,519
  • 8
  • 21
  • 26
30
votes
1 answer

Is there an alternative to "Create or replace procedure" in MySQL?

Is there an version of "create or replace procedure" for MySQL? I can't seem to do this or script the dropping of the procedure if exists before recompiling without getting an error message that the stored procedure exists. DELIMITER $$ -- would…
amatusko
  • 487
  • 1
  • 5
  • 11
30
votes
5 answers

SQL Deadlock on the same exclusively locked clustered Key (with NHibernate) on delete / insert

I have been working on this deadlock issue for quite a few days now and no matter what I do, it persists in one way or another. First, the general premise: We have Visits with VisitItems in a one to many relationship. VisitItems relevant…
Ben
  • 401
  • 4
  • 7
30
votes
2 answers

DDL_admin vs db_owner permissions

I'm taking over a project that involves removing and limiting permissions of all database users across our server farm. (fun times) One of the permissions currently being limited is db_owner permissions. This permission is being reviewed on a…
Reaces
  • 2,601
  • 4
  • 25
  • 38
30
votes
5 answers

How to optimize very slow SELECT with LEFT JOINs over big tables

I was googling, self-educating & looking for solution for hours but with no luck. I found a few similar questions here but not this case. My tables: persons (~10M rows) attributes (location, age,...) links (M:M) between persons and attributes (~40M…
Martin
  • 411
  • 1
  • 5
  • 11
30
votes
4 answers

Is there a way to show the creation statement for an index in PostgreSQL

I need to recreate an index in PostgreSQL which has suffered index bloat. Since I need the index to be usable while it's being created, I can't use REINDEX. I am going to recreate the index with a new name and then drop the old one. Is there any way…
Amandasaurus
  • 927
  • 3
  • 12
  • 15
30
votes
4 answers

pg_restore: [archiver] did not find magic string in file header

I'm using PostgreSQL 9.1 and want to restore backup files generated with pg_dump: sudo pg_dump -h 127.0.0.1 -U postgres --clean --inserts -E UTF8 -f out.sql database_name This command generates a valid sql file that starts with droping any existing…
maja
  • 403
  • 1
  • 5
  • 7
30
votes
6 answers

SQL Server Management studio slow connection or timeout when using Windows Authentication

I'm getting extremely long delays (10~30 seconds) in SQL Server Management Studio 2014 when attempting to connect to a SQL Server 2012 instance over TCP using Windows Authentication. This happens when connecting Object Explorer or a new blank query…
Jordan Rieger
  • 451
  • 1
  • 6
  • 14