database

What DB to use for a windows application?

I am developing a small windows application in .net. What DB should I use? DB Structure Table 1 : Not more than 3 fields : 50+ records (Add, Delete) Table 2 : Not more than 10 fields : 10-20 records (Add, Delete) I thought of using XMLDatabase but some say its not advisable to use it. What are the reasons for this? If it is OK to use...

How would you solve this tricky SQL problem?

Say you have a table layout like the following: couses: id (INT), courseName (VARCHAR) instructors: id (INT), courseId(INT), instructor(VARCHAR) Create a query which will print the all the courses and if one instructor is present display their name, if two instructors are present print both of their names on the row in sorted ord...

Database replication from SQLserver 2000 to SQLserver 2008

I'm trying to replicate a rather large database from SQLServer 2000 to SQLServer 2008, located on two different servers. I found an article about attempting this and have been trying to follow its direction. Here is the article. Mixed Mode Bi-Directional Transactional Replication between SQL 2000 and SQL 2008 Here is the part I'm s...

Performance hit with CLOB/TEXT?

We have a database with a generous use of the CLOB/TEXT datatype all over the schema. After running lots of queries yesterday on multiple tables having a CLOB type, I came to the conclusion that as soon as there is a CLOB in the SELECT clause (even if the value if NULL/empty), the query takes a huge performance hit. We have a client-ser...

Detaching a SQL Server 2005 database that has had it's MDF/LDF file moved or lost.

I created a document management system for a client which uses SharePoint and SQL Server to store PDF documents. Due to some SAN misconfiguration 3 disks that were holding both MDF and LDF database files dissapeared from the OS one day. We are in the process of recovering the data of the SAN but my question is how do I detach an existi...

Why can't I connect to my sql database? I get the error message: "Can't connect to local MySQL server through socket"

I just moved my site to a new web host, and after changing the database-login file, it still can't connect. I get the following error: Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /usr/www/users/simpleof/index.php on line 91 I changed the password and tried a...

Persistent, Distributed and Replicated Key-Value Blob Store

Does anyone have any suggestions on a persistent, distributed and replicated key-value blob store? I've seen this list of key value stores. But they all seem to be for storing small blob values. The blobs I am dealing with range from 2K to 300M in size. What I need is something more like to mogilefs, but mogilefs is optimized for W...

How can I remove all rows that aren't the newest N for each user in MySQL?

Assuming I have a table foo where I have something like this: id, user_id, timestamp, some_value What I want to do is remove all rows that aren't the newest N per user. The deletion itself could be handled by a: DELETE FROM foo WHERE id NOT IN (...) so you could rephrase the problem into: How do I get the newest N(there might be le...

SQL UPDATEing a datebase in VB.NET, having troubles...

I am using a data grid view to display information from a database and I can't get it to update correctly. I can see the data from the database but when I change information and save it it changes the entire column's information. My rows need to have different values in the same column so this is a problem. -Here is my code so far, what...

How to Get Field Name With Query in Zend Framework

How to Get Field Name With Query in Zend Framework Test "Select * From Test1,Test2" how to get all field name in this query Zend Frame work cam do it? ...

Need Help of Sql Database Administrator

I have a database by name database1 and it contain a table by name of employee In employee table have many fields like employee, name, salary etc etc. by mistake i am change salary value 0 for all employee. I am restore database from backup by name database2 Now i need assistance to update my current database which is database1 I wan...

List of special characters for SQL LIKE clause

What is the complete list of all special characters for a SQL (I'm interested in SQL Server but other's would be good too) LIKE clause? E.g. SELECT Name FROM Person WHERE Name LIKE '%Jon%' SQL Server: % _ [specifier] E.g. [a-z] [^specifier] ESCAPE clause E.g. %30!%%' ESCAPE '!' will evaluate 30% as true ' characters need to be esca...

Transactional theory

(I have a simple CRUD API in a DAO pattern implementation.) All operations (save, load, update, delete) have a transaction id that must be supplied. So eg. its possible to do: ... id = begintransaction(); dao.save(o, id); sao.update(o2, id); rollback(id); All examples excluding load invocations seems intuitive. But as soon as you sta...

SQL Server Prevent Scripts Being Run on the Wrong Instance...

This is less of a programming question and more of a suggestions for tools one :-) I'm looking for a way to prevent scripts being accidentally run on the wrong sql server instance, ie so you don't run that script for clearing down customers in your development environment on the live/production environment. What I'm basically after is ...

Viewing a database over Collections, ORM Lists...

I've been researching to find out how and what to use to get say the name's of the fields in a class, then to invoke that class and get the properties of the class, as in the field values. Give you an example, Say if I one to get one value from one record from one table, I would create an object of that class as in; DBTable<cars> cartab...

Fast unsafe easy PHP key-value database?

I need to store JSON strings against string keys (that should be like 255 characters long). Only querying by key is necessary, so basically just a persistent hash table. It doesn't need to be very safe to write to, but should be kind of fast (few thousand writes per second on single box). If two processes happen to try to write the same ...

database schema design tools / modular database design

hello, I'm developing applications which can be build partly from modules. For example I would be able to develop some online community which contains the modules 'forum', 'blog', 'gallery', etc. Currently I have one large database ERM containing all the tables of all modules with foreign-key connections and I'm using dbwrench to build...

Referrals DB schema

I'm coding a new {monthly|yearly} paid site with the now typical "referral" system: when a new user signs up, they can specify the {username|referral code} of other user (this can be detected automatically if they came through a special URL), which will cause the referrer to earn a percentage of anything the new user pays. Before reinve...

Using both a GUID and an auto-incrementing integer

I've been investigating the use of GUIDs as primary keys in databases. So far, the pros seem to outweigh the cons. However, I see one point where GUIDs may not be what I want. In my application, users should be able to identify objects based on a user-friendly ID. So, for example, if they want to get a specific product without typing in...

SQL Server 2005 - Trigger Loop?

I am using triggers for the first time. If I update a field in a table by an update trigger on the same table, with this spark a loop? Does sql server guard against this recursive behavior? Thanks ...