database

Xml or Sqlite, When to drop Xml for a Database?

I really like Xml for saving data, but when does sqlite/database become the better option? eg, when the xml has more than x items or is greater than y MB? I am coding an rss reader and I believe I made the wrong choice in using xml over a sqlite database to store a cache of all the feeds items. There are some feeds which have an xml fil...

What are some techniques for stored database keys in URL

I have read that using database keys in a URL is a bad thing to do. For instance, My table has 3 fields: ID:int, Title:nvarchar(5), Description:Text I want to create a page that displays a record. Something like ... http://server/viewitem.aspx?id=1234 1) First off, could someone elaborate on why this is a bad thing to do? 2) and se...

How to programmatically make a Query in MS Access default to landscape when printed

How can I programmatically make a query in MS Access default to landscape when printed, specifically when viewing it as a PivotChart? I'm currently attempting this in MS Access 2003, but would like to see a solution for any version. ...

SQLite3::BusyException

Running a rails site right now using SQLite3. About once every 500 requests or so, I get a ActiveRecord::StatementInvalid (SQLite3::BusyException: database is locked:... What's the way to fix this that would be minimally invasive to my code? I'm using SQLLite at the moment because you can store the DB in source control which makes ba...

How often should Oracle database statistics be run?

In your experience, how often should Oracle database statistics be run? Our team of developers recently discovered that statistics hadn't been run our production box in over 2 1/2 months. That sounds like a long time to me, but I'm not a DBA. ...

How do you know what a good index is?

When working with tables in Oracle, how do you know when you are setting up a good index versus a bad index? ...

How do you interpret a query's explain plan?

When attempting to understand how a SQL statement is executing, it is sometimes recommended to look at the explain plan. What is the process one should go through in interpreting (making sense) of an explain plan? What should stand out as, "Oh, this is working splendidly?" versus "Oh no, that's not right." ...

Can any database do math?

Can databases (MySQL in particular, any SQL--MS, Oracle, Postgres--in general) do mass updates, and figure out on their own what the new value should be? Say for example I've got a database with information about a bunch of computers, and all of these computers have drives of various sizes--anywhere from 20 to 250 GB. Then one day we upg...

backup data for reporting

What is the best method to transfer data from sales table to sales history table in sql server 2005. sales history table will be used for reporting. ...

How best to copy entire databases in MS SQL Server?

I need to copy about 40 databases from one server to another. The new databases should have new names, but all the same tables, data and indexes as the original databases. So far I've been: 1) creating each destination database 2) using the "Tasks->Export Data" command to create and populate tables for each database individually 3) ...

How do you design data models for Bigtable/Datastore (GAE) ?

Since the Google App Engine Datastore is based on Bigtable and we know that's not a relational database, how do you design a database schema/data model for applications that use this type of database system? ...

Best way of store only date on datetime field?

Scenario: A stored procedure receives from code a DateTime with, let's say DateTime.Now value, as a datetime parameter. The stored procedure needs to store only the date part of the datetime on the row, but preserving all date related arithmetics for, to say, do searches over time intervals and doing reports based on dates. I know the...

What is the best Document-oriented database?

We all know RDBMS, but what about Document-oriented databases? Consider the things that you leave an RDBMS to do, like indexing, complex query structure, mathematical functions, storage, transactions etc... ...

Is there any good tool for working on Database apart from Toad which requires license and DBVisualiser not supportive

Is there any good tool for working on Dabtabase apart from Toad which requires license and DBVisualiser not supportive ...

Hibernate Tools and the ever changing database

I am currently using Hibernate Tools 3.1; I customized naming convention and DAO templates. The database (SQL Server 2005) in early development phase and I'm in charge of rebuilding the mappings, entities, DAOs, configuration, whatever. Each time I have to reverse-engineer the tables and so I lose every customization I made on the mappin...

Query to find nth max value of a column

I want to find 2nd,3rd..nth maximum value of a column ...

How can I merge many SQLite databases?

If I have a large number of SQLite databases, all with the same schema, what is the best way to merge them together in order to perform a query on all databases? I know it is possible to use ATTACH to do this but it has a limit of 32 and 64 databases depending on the memory system on the machine. ...

Postgres replication

Right now I have a database (about 2-3 GB) in PostgreSQL, which serves as a data storage to RoR/Python LAMP-like application. What kind tools are there that are simple and robust enough for replication of the main database to a second machine? I looked through some packages (Slony-I and etc.) but it would be great to hear real-life sto...

Why wouldn't DB2 let me have a column in WHERE clause?

I have a remote DB2 database that I'm accessing through ODBC. When I have a query like SELECT t.foo, t.bar, t.problemcolumn FROM problemtable t WHERE t.bar < 60; it works like a charm, so the table and columns obviously exist. But if I specify the problem column in the WHERE clause SELECT t.foo, t.bar, t.problemcolumn FROM problemta...

Differences between NHibernate, Castle, Linq - Who are they aimed at?

This answer says that Linq is targeted at a slightly different group of developers than NHibernate, Castle, etc. Being rather new to C#, nevermind all the DB stuff surrounding it: Are there other major, for lack of a better term, SQL wrappers than NHibernate, Castle, Linq? What are the differences between them? What kind of developers...