8
votes
2answers
368 views

Do agile software development approaches apply to SQL?

I would like to learn if agile software development methods/principles/patterns are valid to SQL programming as well. If yes, where would be a good place to start learning about that? Are there any ...
0
votes
2answers
277 views

Attempting to avoid SORT in query planner

I have a query that is used VERY frequently in my application. Without modifying the query itself, I'm trying to optimize it by toying with different indexing schemes. Here's the query (basically): ...
4
votes
1answer
235 views

Merge Replication Large Table

We have a two SQL Server instances that use merge replication to keep in sync. There is a single table that potentially can add millions of rows in between syncronisations (which is a relative small ...
2
votes
1answer
708 views

Escaping a single quote in SQL Server

The recommendations I have come across advise that single quotes in SQL Server should be escaped using two single quotes. Thus Ravi's becomes Ravi''s. Another alternative is to use parameters. In ...
7
votes
5answers
5k views

What's a good tool for visualizing SQL Agent jobs? [closed]

I find the built-in MS SQL Studio tools for managing Agent jobs to be a little frustrating. What tools out there have you found helpful? Offhand, there are three things I'd like to see in such a ...
1
vote
1answer
71 views

Is it safe to change the name of a database?

I have a SQL Server database which has data for several customers/devices. We are changing the prefix of our website (asp.net) and our application dynamically loads the proper connection string based ...
5
votes
2answers
303 views

How to find out what is causing my Identity column to keep going up

I have a table with an int identity as the PK. Something is causing it to increment, and I'd like to know what that is. To give a quick example, yesterday I inserted a record and got ID 41,773. Today ...
1
vote
0answers
504 views

How to customize Place Order Functionality In Magento? [closed]

In Magento, when any customer buys product from front-end, then at last customer goes through order placing. According to my need, I have created one CUSTOM TABLE in Magento database. So my ...
3
votes
2answers
2k views

What is the difference between a SQL Login and a Database User in terms of security?

I am currently working with a consulting agency to set up a new production environment. They have set up a separate SQL login for each database. However, there is no corresponding database user ...
3
votes
2answers
2k views

Using Foreign Key and References for ON DELETE CASCADE in mysql

I was thinking that these two ways for creating foreign keys are the same CREATE TABLE child1 ( id int(11) not null auto_increment, parent_id int(11) REFERENCES parent_table(parent_id) ON DELETE ...
4
votes
1answer
83 views

Issue with CAST using linked servers (possible bug?)

So I've got a some SQL Server 2008 DBs arranged in a star schema. Server A is the one users submit queries to. On Server A there is a DPV called Detection that's basically a UNION of table Detection ...
4
votes
1answer
6k views

How can I call a remote User Defined Function with Parameters?

We have one SQL server which contains a link to another server that is on a different box. I would like to create a user-defined-function on ServerA which returns the value of the udf on ServerB, ...
2
votes
1answer
99 views

Is there a restriction which prevents you from creating a user and a role with the same name?

I have a (SS2005) database with a user named MY_APPLICATION_USER. I'm trying to create a role in that database named MY_APPLICATION_USER. When I try to do that using this script: /****** Object: ...
2
votes
1answer
799 views

PostgreSQL partitioning query performance inexplicably bad

I find this a bit mysterious. The cost of getting the maximum value out of just the partition parent table (which is empty) is very cheap: evlampts=# explain select max(timestamp) from only mcdata; ...
0
votes
1answer
54 views

Start Windows Service If Replication Fails

Setup: We have SQL Server Management Studio 2005 SP3 on all of our Servers. We have 1 Main Server, and 1 Secondary Server that has the database from the Main Server being replicated on it. (If it ...
2
votes
1answer
754 views

Number of locks exceeded when adding foreign key constraint

I'm adding a foreign key constraint to table a (17mil rows) that references table b (15mil rows): >ALTER TABLE a ADD FOREIGN KEY (b_id) REFERENCES b (id); ERROR 1206: The total number of locks ...
3
votes
2answers
1k views

Is this procedure to Failover to Logshipped secondary and Fail back again procedure correct?

I have a primary database in Amsterdam (AMDB), and a secondary in London (LNDB). I want to fail over from AMDB, to LNDB and then back again, without having to make another full backup (because the ...
1
vote
2answers
4k views

How do I determine why my stored procedure is getting deadlocked?

We have a stored procedure that our application uses to query data (no write operations are performed). I have the complete staging database copied to my local version of Sql Server developer edition. ...
0
votes
0answers
436 views

Why is MySQL making the CPU run at about 80%?

MySQL is eating up about 80% of my CPU for no reason as far as I can see. Right now this server is rarely used, more of a test site I set up that will eventually be a used for production once I fix ...
0
votes
2answers
237 views

shall I use multiple separete tables or one table with multiple partition on oracle

I have an entity lets call it Response, and another entity called ResponseType, Response entity contains the ResponseType; so when I am building the physical model I confused with how to implement it; ...
0
votes
1answer
356 views

Database Design: What is the best structure for storing site offices and locations?

Background I am creating a database driven web application for the management team at the place I work. Part of this application requires fairly specific locations to be linked with where equipment ...
1
vote
2answers
10k views

SSIS SQL Server 2008 errors

I just want to know how to import data from source to SQL Server 2008 database using SSIS. I have a simple txt file (actually it's from this blog : ...
1
vote
2answers
1k views

Postgresql 9 table lock resolution

I have an ALTER TABLE statement that according to pg_stat is "waiting", and I'm wondering if there is an easy fix to allow the statement to execute? From my limited understanding I think it's a ...
3
votes
1answer
995 views

mysql, changing tables from myisam to ndb

Gents, Converting a table from myisam to ndb via: ALTER TABLE piwik_log_profiling ENGINE NDBCLUSTER; This will fail with: BLOB column 'query' can't be used in key specification with the used ...
0
votes
1answer
46 views

Copying a subscribed database to the publisher server

I have two servers. I have installed a merge replication in the publisher (Server A) and I have added two subscriptions with the same database name. - One on the publisher itself and the seconde one ...
2
votes
3answers
2k views

Reference a newly created computed column in the same query where we create it

SELECT (SUBSTRING(Column1,1,3)) AS ComputedColumn WHERE ComputedColumn !="dec" INTO Table2 FROM Table1; This is an example where I have a computed column (which is essentially created by using an ...
2
votes
2answers
4k views

Deadlock on Insert/Update

Using SQL Server 2008 R2: I'm currently attempting to track down the cause of a deadlock issue we have. Not sure where to turn. Here's the setup. TABLE Scores: id INT IDENTITY(1,1), first_name ...
13
votes
4answers
9k views

SQL Server database on an SSD - any advantage to a separate file for every table?

I'm creating a database in which there will be around 30 tables, with every table containing tens of millions of rows and each table containing a single important column and a primary/foreign key ...
2
votes
2answers
204 views

Overhead of DBMS_Profiler

If I use DBMS_Profiler to profile a long running (5 hour) PL/SQL script, how much longer should I expect the script to run with profiling? I realize this will be dependent on what the script is ...
0
votes
1answer
8k views

How to set up tns listeners for Multiple Oracle Installations on One machine

So I have two oracle installations on a development/testing machine (10g and 11g, respectively). The platform is RHEL4. Now I need to have both these oracle up and have tns listeners for them ...
1
vote
2answers
5k views

Innodb UPDATE performance

We recently switched one of our tables to innodb and now we are experiencing very slow UPDATE execution times. An update which used to take 0.010-0.030 seconds can now take over 70 seconds. Some ...
1
vote
4answers
219 views

Database growth causing issues sending backup over network

We take a full database backup on our primary SQL Server, and send that file over our network to a remote site where it is recovered on a backup SQL Server. We use this backup database for slow ...
4
votes
1answer
637 views

Sql Server Index Data File Drive Location

As part of my ongoing saga of migrating from one SAN to another, the new SAN vendor said that I need to have my index data file in the same drive as my primary data file. Otherwise, given the tools ...
4
votes
1answer
1k views

Can SHOW TABLE STATUS query performance on MySQL be improved - Amazon RDS

I have a fairly large database on the Amazon Relational Database Service (RDS) running on MySQL 5.1.57. There are 900+ tables, so that running the "SHOW TABLE STATUS" query can take up to 30 seconds. ...
3
votes
2answers
2k views

MySQL connection count much larger than query count

I'm maintaining a relatively simple LAMP server. It does how ever have a some what high load. What I'm noticing is that in a one hour time span there are roughly 50k connections made to the mysql ...
2
votes
2answers
715 views

Cancel SQL Job execution make automatic rollback

I have a SQL SP which has a set a transaction. All the statements handled inside the TRY CATCH block. If we explicitly cancel the job by close the button in the JOb execution window, will it get into ...
8
votes
1answer
1k views

Schema designing for handling multiple payment gateways

This is more of a question that requires feedback. I'm designing a database that handles multiple payment gateways. A payment gateway mostly requires a table for order details before making the ...
1
vote
1answer
416 views

Database Tuning Advisor can't find tables across two databases

I've got a Python script which accesses two SQLServer 2008 databases. If I run it and take a trace to capture all events that occur as a result of the script, and then put that trace through the ...
-15
votes
1answer
1k views

Please help with these database interview questions [closed]

What is your company backup policy? If something happend to your db how to restore it? What type of clustering present used in your enviroment? Whis is the best replication? Why? If sql server want ...
2
votes
3answers
724 views

Which database is best for deeply embedded database or through C DLL?

I want a deeply embedded database. Deeply embedded means that the server is started by an application and closed by the application with no tcp/ip or 0 port. The main features of consideration are: ...
2
votes
1answer
969 views

How can I use a MySQL query in an openquery query on Microsoft SQL Server.?

I have the following query which works fine in MySQL: DELETE sb FROM stockbatches sb INNER JOIN batchestodelete btd ON sb.batch_batch = btd.batchno AND sb.batch_part = btd.batchpart ...
2
votes
5answers
8k views

How to check the status of SQL Server?

I need to check the status of SQL Server. When I say status its not the status for each database, but rather for the whole SQL Server. I need to know what are the queries running in the server and ...
3
votes
4answers
5k views

How to create rolling backups for SQL Server 2008 R2

I want to run daily backups for a set of databases to disk such that I always have 3 days’ worth of backups kept for each database, with the oldest backup being deleted or overwritten each day. I set ...
0
votes
1answer
438 views

How do I restore a SQL backup, while excluding a specific table?

How do I exclude a specific table during a SQL backup RESTORE operation? My question is specific to restoring a backup sql file. I am using Putty and bash server.
2
votes
3answers
990 views

Move Oracle data to and from MySQL with the help of PHP?

My application is in PHP which by default uses MySQL db. I have connected MySQL & Oracle dbs with PHP. Now I want to move data from Oracle db into Mysql db through PHP. Is it possible to do? Is ...
7
votes
1answer
984 views

How are deadlocks detected and reported in an RDBMS?

I was given this essay type question during an interview but did not get the job. The full question was as follows: How are deadlocks detected and reported in an RDBMS? What are the transaction ...
3
votes
3answers
603 views

MySQL: ORDER BY useless?

CREATE TEMPORARY TABLE tt; INSERT INTO tt; many times SELECT FROM tt ORDER BY id LIMIT ?,1000; The temp table is created at the beginning of the script having an "id" auto_increment column (and ...
3
votes
3answers
2k views

How to restructure this slow query containing subquery?

This query takes about 2-6 seconds to run depending which tag id(s) is/are selected: SELECT t2.id, t2.name, count(*) as kpl FROM (SELECT pt1.post_id FROM posts_tags pt1 WHERE pt1.tag_id ...
10
votes
3answers
10k views

Why can't relational databases meet the scales of Big Data?

It is often repeated that the Big Data problem is that relational databases can not scale to process the massive volumes of data that are now being created. But what are these scalability limitations ...
2
votes
1answer
340 views

Referring to super parent or as a separate entity?

I have this person table as super parent, id firstname lastname email telephone ... ... and user table as a child id person_id (FK) password username screenname ... ... They must be 1:1 ...

15 30 50 per page