database

How to separate confguration file?

Hello, I have a .net solution having a reference hierarchy like this MyWinApp->ServerCore->DataAccess where the last two are class libraries and myWinApp is a windows app. Now, each time I want to run this project on different servers I need to rebuild the project since I couldn't manage to separate the configuration file(app.config)...

How to determine the connected database type in VB6?

Hi all, I'm writing an application that is able to be connected to multiple types of database (eg: SQL Server, Oracle, MySQL, etc). It's an international-targeted application, so I ideally want to be able to do this without needing to rely on string literals if possible. At the moment, I'm checking the driver name and using a case state...

Good Database-Design has no identity-columns in the tables, right?

Hi there, what is the benefit of having an additional identity column in each table of a database? What are the drawbacks? Update: Now i want to expand the case and introduce replication. What for is this surogate key (identity comlumn) aside of the rowguid we get with the replication. Behalf of K. Brian Kelley's objection one should s...

Eliminating record duplicates in the Entity Framework database

I work with Entity Framework - add records in the database using classes that map to the DB. But i need to make sure I dont add duplicate records in the database. I assumed that when SaveChanges() is called, it sorts out all the duplicates, but it doesnt. Is there a way to eliminate creation of the duplicate records? ...

Dynamic or column-ized tsvector index?

I'm creating custom forum software for a site I'm building, which includes 2 tables (that are relevant to this question): topics and posts. A post belongs to a topic, and the topic contains the subject, while each post contains the body. Here is the basic table structures with the columns relevant to my question: CREATE TABLE topics (...

what does a B-tree index on more than 1 column look like?

So I was reading up on indexes and their implementation, and I stumbled upon this website that has a brief explanation of b-tree indexes: http://20bits.com/articles/interview-questions-database-indexes/ The b-tree index makes perfect sense for indexes that are only on a single column, but let's say I create an index with multiple colum...

Hibernate updating database structure with new indexes

Hi All. It's well known fact that hibernate work with indexes in a very strange way. It generate them only if you create a database schema from the scratch. But if you try to update the database schema hibernate will ignore new indexes. My question is, does anybody find a solution how to ask hibernate generate SQL for new indexes durin...

what is sequence (Database) ? When we need it ?

why we create a sequence even if primary key is there ? ...

How to store parts of form-data when they're on separate pages?

Whenever I'm to prepare a long form for the client I always want to split it into separate pages, so the visitor doesn't have to fill it all, but does it in steps. Something like: Step 1 > Step 2 > Step 3 > Thank You! I've never done it for one reason: I don't know how to store the data from separate steps efficiently? By efficien...

In native C++, how does one use a SqlCe .sdf database?

Is there a simple way, without .NET? I've found some libraries but none for SqlCe 3.5. There is http://sqlcehelper.codeplex.com/ but it's far from done, since a major feature like using a password is not yet implemented. I've looked at the source and it uses OLEdb to handle the database. The offical Microsoft Northwind example (that is...

PostgreSQL analog of SQL Server index

Trying to recreate my SQL Server database on PostgreSQL. Everything is ok except I can't find how to recreate this index: USE [mytablename] GO CREATE NONCLUSTERED INDEX [myindex] ON [dbo].[mytablename] ([col1],[col2]) INCLUDE ([col3],[col4]) GO Will be very grateful for help. Alexey Update: http://img38.imageshack.us/...

Storing PDO details in php.ini

According to the PDO documentation, you can store database login details in php.ini, away from the php file (example 3). But it does not explain how to store username and password, only the database and host. How would you do that? This is the method used in the documentation: [PDO] pdo.dsn.mydb="mysql:dbname=testdb;host=localhost" I...

How to generate unique ID's on a cluster of web servers

In the following scenario: 1 Database 4 Web servers How do the Web servers generate unique ID's for the database so that they are unique? Yes it's possible to use Auto-increment, but this is too easily crawled/guessed/etc. So auto-increment is currently not an option. ...

Values not showing in Access form combo box

Hi, I have an application in Access 2003 that I am working on. In it, I have an employee table, which is connected to two other tables. The two connected tables are tables that hold a few fixed KeyWords. In my main employee table, I just have the ID from the other table, rather than having the whole word. I wanted to make a form for e...

codeigniter image uploading mysql

hi, I wanted to know if I was uploading an image in codeigniter to a database what would be my $config['upload_path'] all the examples I have seen are using the filesystem. I have articles in a db and would like to store images relating to articles in the db as well. Can anyone help? ...

server side db programming: why?

Given that database is generally the least scalable component (of a web application), are there any situations where one would put logic in procedures/triggers over keeping it in his favorite programming language (ruby...) or her favorite web framework (...rails!). ...

Simple Database Handling

I am using C# in Visual Studio to modify an ASP web application. The application is currently using SQL Server as it's database. SQL Server is way overkill for this application. We're talking 1 table, maybe 40 - 50 records, with maybe 2 add/modify/delete transactions a week. I'd like to get the client off SQL Server, as they're paying ...

How do I connect to an MS Access database using Perl?

I have a .accdb file on my local machine and I am trying to connect to it and read some data from 3 tables within the DB. How do I establish the connection using Perl? So far I have scraped together this much for MS Access, but I am getting errors saying that I am not using the correct driver. Any ideas? my $msaccess_dbh = DBI->connect...

Survey Data Model

I'm developing a simple survey module for an ASP application I'm working on and I'd like to get some suggestions on the data model. Questions can be one of three types - multiple choice, multiple answer; multiple choice, single answer, and free response. I'm thinking of the following tables: Question - with a question type discrimi...

Company internal number

I'm brazilian and I'm developping a management software for internal use in the company I'm working on. I'd like to know a common english term to describe an imployee's internal company registry number. I've been thinking in "registry number" or something like that. ID is not suitable because the DB table already has an ID field. Can any...