Most Popular

1500 questions
25
votes
3 answers

Efficency of stored procedures vs raw queries

I have read much on both sides of this debate: is there a signficant performance gain to be had by using only stored procedures over raw queries? I am specifically interested in SQL Server but would be interested in any and all databases.
stimms
  • 353
  • 3
  • 7
25
votes
8 answers

Tool to generate large datasets of test data

Many times when trying to come up with an efficient database design the best course of action is to build two sample databases, fill them with data, and run some queries against them to see which one performs better. Is there a tool that will…
BenV
  • 4,893
  • 7
  • 39
  • 38
25
votes
2 answers

How can I get my linked server working using Windows authentication?

I'm trying to get a linked server to ServerA created on another server, ServerB using "Be made using the login's current security context" in a domain environment. I read that I'd need to have SPNs created for the service accounts that run SQL…
Christopher Garcia
  • 609
  • 3
  • 8
  • 12
25
votes
8 answers

Why is it a bad practice to allow everyone to use the sa login?

Even Microsoft discourages the use of SQL Server authentication mode, but our applications require it. I've read that it's a best practice to not let users use the sa login directly, instead using Windows Authentication and allowing those accounts…
Jon Seigel
  • 16,882
  • 6
  • 44
  • 84
25
votes
3 answers

How can I reset a mysql table auto-increment to 1 in phpMyAdmin?

I know that in MySQL at the command line I can reset a table's auto-increment field to 1 with this: ALTER TABLE tablename AUTO_INCREMENT = 1 I am curious if there is a way to do this from within phpMyAdmin. Something like a check box to reset the…
BitBug
  • 355
  • 1
  • 5
  • 9
25
votes
3 answers

Should I stop transaction log backups during a full backup?

I have two SQL Agent jobs which are scheduled to run at different intervals. The first job runs a full backup once a day. The second job runs transaction log backups every fifteen minutes. As the database has grown, the full backup is taking longer…
8kb
  • 2,629
  • 2
  • 32
  • 35
25
votes
12 answers

Why are constraints applied in the database rather than the code?

Why are constraint applied in Database? Will it not be more flexible to put it in the code? I'm reading a beginners book on implementing databases, so I'm asking this as a beginner. Let's say I have designed a database, including this entity model: …
hkoosha
  • 369
  • 3
  • 7
25
votes
3 answers

Is it common practice to mix InnoDB and MyISAM tables on same server?

I've got a single database of about 4.5GB running on a server with 8GB RAM. The vast majority of the tables are MyIsam (about 4.3GB), but I'm soon going to be converting some of them to InnoDB. (It's going to be a slow process, focusing on the most…
Derek Downey
  • 23,440
  • 11
  • 78
  • 104
25
votes
1 answer

What exactly does "No Join Predicate" mean in SQL Server?

MSDN "Missing Join Predicate Event Class" says it "indicates that a query is being executed that has no join predicate". But unfortunately it does not seem to be as easy as that. For example, very simple situation: create table #temp1(i…
Jānis
  • 1,248
  • 2
  • 13
  • 21
25
votes
3 answers

Recommended page file size for SQL 2008R2 on Windows 2008R2

This Microsoft article - How to determine the appropriate page file size for 64-bit versions of Windows Server 2008 and or Windows 2008 R2 provides guidance for calculating the page file size for 64 bit Windows 2008 and Windows 2008R2. This no doubt…
Kev
  • 1,336
  • 5
  • 14
  • 24
25
votes
5 answers

PostgreSQL: Creation date of a table

I've recently finished a project, during which many DB tables were created. Most of these tables contain temporary garbage, and I am looking for a simple way to list all these tables. Is there a way to list all DB tables sorted according to their…
Adam Matan
  • 11,659
  • 29
  • 80
  • 95
25
votes
3 answers

Running pg_dump on a hot standby server?

Disclaimer: I admittedly haven't tried this yet, but I'm not sure I would know if it wasn't working correctly, so I wanted to ask. I would like to run a nightly backup job (via pg_dumpall) from a hot standby server running streaming replication, to…
jberryman
  • 471
  • 1
  • 5
  • 11
25
votes
7 answers

Oracle - Any way to view uncommited changes to a particular table?

I'm debugging through a batch process currently that does a lot of DML statements, but doesn't do a commit right away. It would be nice to be able to view the "pending" changes from another session while the transaction is not committed. Is this…
contactmatt
  • 411
  • 1
  • 5
  • 9
25
votes
9 answers

Login failed for user - Error 18456 - Severity 14, State 38

Message that SQL Server Log File Viewer shows: Login failed for user [User] Error: 18456, Severity: 14, State 38 What it actually means: Failed to open the explicitly specified database My Question: Is there a list somewhere of all the variations…
Pete Oakey
  • 649
  • 1
  • 6
  • 12
25
votes
6 answers

SQL Server Management Studio 2012: How to have folders in the SSMS project?

I'm using SSMS 2012 to talk to the SQL server 2012 and Azure SQL servers we use. I admit I'm not a SQL expert so I've been saving most of my SQL scripts for future reference. I've quickly run into 20 or so .SQL scripts in the SSMS project and they…
DeepSpace101
  • 487
  • 1
  • 5
  • 7