database

CommandType.Text vs CommandType.StoredProcedure

Is there any benefit to explicitly using the StoredProcedure CommandType as opposed to just using a Text Command? In other words, is cmd = new SqlCommand("EXEC StoredProc(@p1, @p2)"); cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@p1", 1); cmd.Parameters.Add("@p2", 2); any worse than cmd = new SqlCommand("StoredProc"); cmd...

How to handle promo code assignment in the Entity Framework without collisions?

Let's say I have a table of promo codes, and a table of contacts. Each contact can have 1 promo code, and each promo code can only be assigned to 1 contact. How would I employ an assignment program that would select a promo code from the table, and assign it to a contact, without having concurrency issues/collisions. Worst case scenar...

What are the advantages of CouchDB vs an RDBMS

I've heard a lot about couchdb lately, and am confused about what it offers. ...

Local Database vs Service-based database when building a WPF Client application

I'm building a simple WPF client application that is going to store data locally. My question is Local Database enough? I don't know the amount but there could be a few lines in the future when I'm tracking time. Except some performances issues like stored procedures what else do I lose when choosing the local version? I'm boxing mysel...

Large/complex dataset for ORM validation?

I'm looking for freely available sample data to do some ORM validation and performance testing on. My main requirements are: Discriminated types: it needs to include some kind of inheritance eg Party -> Person and Organisation; Reasonably complex data model; Some reasonably large tables (in the hundreds of thousands of rows at least);...

Runtime query analysis and optimization

Hi everyone, I'm wondering if there's some sort of runtime mechanism that would observe the queries that are running against my database server; record how many queries of each "type" are running; look at the performance of these queries; then, based on this runtime data, suggest what indexes need to be added/removed. I'm working aga...

How to map two tables with a foreign key relationship in NHibernate?

There are two tables, Contact and Phone__number. Phone_number contains a column contact_id which is a foreign key to id in Contact table. How do I map these two tables in Nhibernate so that I get List of PhoneNumbers in my contact class. ...

Free database for small datawarehouse

Which free database would you use for a relatively small datawarehouse system? Are there any 'special' databases e.g. multidimensional databases freely available? Which of the free relational databases is best suited for the job? By datawarehouse system I mean a system that will receive some inserts, few updates, next to no deletes an...

Sun one Asp Server hangs for a while

Hi, We are hosting our website on sun one asp server on solaris machine. The backend is oracle 9i. Sometimes our website hangs for 10 mins or so and stops catering the requests. After some time it gets up automatically. Please assist. Thanks, Awanish ...

database relationships

does setting up proper relationships in a database help with anything else other than data integrity? do they improve or hinder performance? ...

Just what is 'A big database'?

Ok, dumb question I know but I see the nebulous comment 'a large database' as well as small and medium and I wonder just what that means. Can someone define what a small, medium and large database is for us SQL neophytes? ...

Applications for using couchDB and a RDBMS together

Wondering if there was a scenario where one would use a document-based DB and a relational DB together in a best-of-both-worlds scenario? ...

What's the point of using Amazon SimpleDB?

I thought that I could use SimpleDB to take care of the most challenging area of my application (as far as scaling goes) - twitter-like comments, but with location on top - till the point when I sat down to actually start implementing it with SDB. First thing, SDB has a 1000 bytes limitation per attribute value, which is not enough even...

What programming language should I use for a windows GUI app that utilizes a database?

I need to create a simple windows app for my father's business that handles employee records that can be entered and retrieved though a search and output to excel or something similar. I was thinking of using C++ and using MySQL as the database. I want to make it as simple and seamless as possible, so I am completely open to suggestions ...

Merging tables in access

I have an MS access database file with 2 tables: t1, t2. Both have primary key, suppose id, but t1 has 3 columns A, B and C, while t2 has columns D, E AND F. Both have the same rows, but each has different columns as stated. What is the easiest way to merge these two tables? Note that they are very big, and exporting to excel, CSV and ...

How to resolve Sybase table locks (VB6)?

I am not a great VB programmer, but I am tasked with maintaining/enhancing a VB6 desktop application that uses Sybase ASE as a back-end. This app has about 500 users. Recently, I added functionality to this application which performs an additional insert/update to a single row in the database, key field being transaction number and the...

Do you lose precision when converting from real to money datatype in sql server?

I have a table with datafields in real datatype. Do you lose precision when converting to money or decimal datatype? ...

Updateable view in mssql with multiple tables and computed values

Huge database in mssql2005 with big codebase depending on the structure of this database. I have about 10 similar tables they all contain either the file name or the full path to the file. The full path is always dependent on the item id so it doesn't make sense to store it in the database. Getting useful data out of these tables goes a...

Where should I store my database username and password in a PHP application?

This is probably true for other languages as well. I've created several websites by now, many of which use databases (usually mySQL). I need to store the database password somewhere in the sourcecode, but this seems like a security problem, and a a bit like a hack. Is there a better way to store the password, apart from a config file whi...

MySQL query (mixing an insert with select)

I have a bunch of rows in a table with columns a, b, c. I'd like to be able to SELECT all rows where say a = 1, and reinsert them with a = 2. Essentially keeping all the rows where column a exist as is, and having a new batch of rows having as a = 2. What's the best query to establish such a multi-INSERT query? This is all happening in t...