database

How can I copy data records between two instances of an SQLServer database

I need to copy some records from our SQLServer 2005 test server to our live server. It's a flat lookup table, so no foreign keys or other referential integrity to worry about. I could key-in the records again on the live server, but this is tiresome. I could export the test server records and table data in its entirety into an SQL scr...

What is the Best Way to Represent Summer Time Rules?

I need to store the summer time (daylight saving time) change-over rules for different world regions in a database. I already have a way of storing regions and sub-regions (so the whole "half of Australia"/Arizona/Navaho problem is taken care of), but I'm wondering what the most efficient schema would be to accomplish this. The two opt...

Embedding the Java h2 database programmatically

At the moment we use HSQLDB as an embedded database, but we search for a database with less memory footprint as the data volume grows. Derby / JavaDB is not an option at the moment because it stores properties globally in the system properties. So we thought of h2. While we used HSQLDB we created a Server-object, set the parameters and...

What is the best way to store media files on a database?

I want to store a large number of sound files in a database, but I don't know if it is a good practice. I would like to know the pros and cons of doing it in this way. I also thought on the possibility to have "links" to those files, but maybe this will carry more problems than solutions. Any experience in this direction will be welcome...

How to update an Access DB from the web?

I'm looking for a way to create an online form that will update an Access database that has just a few tables. Does anyone know of a simple solution for this? ...

How do you avoid adding timestamp fields to your tables?

I have a question regarding the two additional columns (timeCreated, timeLastUpdated) for each record that we see in many solutions. My question: Is there a better alternative? Scenario: You have a huge DB (in terms of tables, not records), and then the customer comes and asks you to add "timestamping" to 80% of your tables. I believe ...

Getting an error when filling a datatable from a data adapter

I am getting this error but only very occasionally. 99.9% of the time it works fine: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. Does anyone have any idea on what the cause could be? I only use that datatable for viewing and not updating so is it possible to ea...

How can I find similar address records?

The workflow is like this: I receive a scan of a coupon with data (firstname, lastname, zip, city + misc information) on it. Before I create a new customer, I have to search the database if the customer might exist already. Now my question: What's the best way to find an existing customer, when there is no unique ID available? PS: I...

database synchronization - SFTP / RMAN / By codes?

Which method you all will recommend and why? ...

How to optimize PostgreSQL Configuration? (Is there a tool available?)

In postgresql you have a wealth of optimizations at hand to configure it for your performance needs. The settings for memory usage are still easy enough, but with other options like the cost factors for CPU and IO which are used for the query optimizer are quite a mystery for me. I wonder if there is a program available which would do le...

Problem joining on the highest value in mysql table

I have a products table... and a revisions table, which is supposed to track changes to product info I try to query the database for all products, with their most recent revision... select * from `products` as `p` left join `revisions` as `r` on `r`.`product_id` = `p`.`product_id` group by `p`.`product_id` order by `r`.`modified` ...

Primary Key versus Unique Constraint?

Hi! I'm currently designing a brand new database. In school, we always learned to put a primary key in each table. I read a lot of articles/discussions/newsgroups posts saying that it's better to use unique constraint (aka unique index for some db) instead of PK. What your point of view? ...

Simple .net portal. Easy to add new modules

I am writing a simple database with web access. I have previous experience with microsoft's (very!) old IBuySpy portal system. I am sure there must be something a bit more up to date I could use now! I want a simple light weight system that will allow my friend to have tabs with news and pictures etc, and it be easy for me to add tabs ...

Composite primary keys versus unique object ID field

I inherited a database built with the idea that composite keys are much more ideal than using a unique object ID field and that when building a database, a single unique ID should never be used as a primary key. Because I was building a Rails from end for this database, I ran into difficulties getting it to conform to the Rails conventi...

What is the ideal data type to use when storing latitude / longitudes in a MySQL database?

Bearing in mind that I'll be performing calculations on lat / long pairs, what datatype is best suited for use with a MySQL database? ...

Pivot Table and Concatenate Columns - SQL Problem

I have a database in the following format: ID TYPE SUBTYPE COUNT MONTH 1 A Z 1 7/1/2008 1 A Z 3 7/1/2008 2 B C 2 7/2/2008 1 A Z 3 7/2/2008 Can I use SQL to convert it into this: ID A_Z B_C MONTH 1 4 0 ...

Is it OK to put a database initialization call in a C# constructor?

I've seen this is various codebases, and wanted to know if this generally frowned upon or not. For example: public class MyClass { public int Id; public MyClass() { Id = new Database().GetIdFor(typeof(MyClass)); } } ...

Updating two tables in a many-to-one relationship through a view in PostgreSQL

I have two tables: foos and bars, and there is a many-to-one relationship between them: each foo can have many bars. I also have a view foobars, which joins these two tables (its query is like select foo.*, bar.id from foos, bars where bar.foo_id=foo.id). EDIT: You would not be wrong if you said that there's a many-to-many relationship ...

What tools are available for providing a breakdown of the diskspace used by an SQL Server database

I have an MSDE2000 database which appears to be approaching it's 2Gb limit. What tools can I use to determine where all the space is being used? Ideally think TreesizePro for SQL Databases ...

Firebird 1.5.3: How to add FK with connected users to the DB?

I use FB1.5.3 and need to eventually add some FK to the database. It happens that if I try to do it while anyone else is connected to the DB I get an exception. Is there a way to add an FK while the system is running? ...