database

ASP.NET MVC 2 Validation - check name is unique

Hi, In a MVC + ActiveRecord scenario, would it be possible/recommendable to validate db dependent properties as part of model binding? How would you go about implementing this - custom validation attribute? A db dependent attribute could be active records ([Property(Unique=true)]. A simple example of its usage: public class Person ...

Grant on multiple databases. MySQL

How to grant on multiple databases? MySQL. Something like GRANT SELECT,INSERT,UPDATE,DELETE,CREATE ON 'databasesprefix%'.* TO testuser@localhost IDENTIFIED BY 'testpasswd'; ...

Database Design Questions - Need Clarifications

hi guys i m designing a database using sql server 2005 main concept of our side is to import xml feeds from suppliers different supplier can have different representation of data the problem is i need to design table to store imported information some of the columns are fixed means all supplier products must have similar data comi...

Allowing user to download, edit and upload a database table.

I'm looking to create an easy way for a user to create a table, and upload it to the server using ftp. On the server side, I'd like to query this table like an SQL-like query. As I'd like the user to edit this in something like OO Calc, or MS Excel, would csv files be the best/fastest to parse? Is doing a fgetcsv a good way? Could you s...

EF : DeleteObject() in foreach loop

With Entity Framework, I try to delete some objects from my object context like that : foreach (var item in context.Items.Where( i => i.Value > 50 ) ) { context.Items.DeleteObject(item); } With this code, I have a "Collection Was Modified" Exception. So, how can I do a batch delete ? ...

How do I connect to Informix with .NET?

Background Information: Visual Studio 2010 (.NET Framework 4.0) Informix Server 7.31 Informix ClientSDK 3.50 TC7 (Windows 32-bit) was installed as well. I have tried multiple ways suggested online to connect to the Informix server, but all of them do not work for me for whatever reason. I have looked at articles such as Connect Info...

Core Data: Error, "Can't Merge Models With Two Different Entities Named 'foo' "

I'm working on an iPhone app that uses Core Data. Most times, I just test in the simulator, but occasionally pump the app down to the iPad to make sure. I've recently changed my Core Data model, and now when I send the app to the iPad, I get a SIGABRT exception telling me: Can't merge models with two different entities named 'foo' O...

Access Redis from relational databases

Is there any way to access Redis data from relational databases, such as Oracle or SQL Server? One use case I have in mind is ETL to a data warehouse. ...

Numeric types and row size in MySQL

I have a user table structured like this: id MEDIUMINT(7), username VARCHAR(15) Would it technically be faster if I changed it to this instead: id MEDIUMINT(5), username VARCHAR(15) I'm confused because even though the total row length in terms of characters and digits would be shorter, I assume the number of bytes used would b...

Optimal way to handle .dbf from C#

What data-provider can I use to update .dbf file from C#? I tried a few different .dbf providers to create a DataSource but I get a message like this: "Error Message: ERROR HYC00 Microsoft ODBC dBase Driver Optional feature not implemented." Or when I generated a dataset and a dataadapter with an update function I got: "Update requires...

SQL: Find and Replace with SQL?

I have a MySQL InnoDB database. I have a column my in 'article' table called url that needs to be updated. Stored in article.url = /blog/2010/article-name /blog/1998/the-article-name /blog/... I need to change /blog/ to /news/. (E.g. now article.url = '/news/...') What is the SQL needed to replace "/blog/" with "/news/" in the art...

What is a way to handle database connection failure in Django 1.2?

What is a way to handle database unavailability and redirect queries from unavailable slave to another one in Django 1.2? Btw, i found out, that it was discussed: http://code.djangoproject.com/wiki/MultipleDatabaseSupport#Requirements (see "Transparently handling database failure") UPD> I use PostgreSQL backend (probably will use pg po...

implementing complex algorithms on database stored information

Hey, I'm trying to figure out the best practice for implementing a complex algorithm on stored information in a relational DB. Specifically: I want to implement a variation of the k-means algorithm (a document clustering algorithm) on a large MS SQL Server database containing TFxIDF vectors of many documents (these vectors are used as ...

Few database design questions relating to user content site

Designing a user content website (kind of similar to yelp but for a different market and with photo sharing) and had few databse questions: Does each user get their own set of tables or are we storing multiple user data into common tables? Since this even a social network, when user sizes grows for scalability databases are usually par...

Are document databases good for storing large amounts of Stock Tick data?

I was thinking of using a database like mongodb or ravendb to store a lot of stock tick data and wanted to know if this would be viable compared to a standard relational such as Sql Server. The data would not really be relational and would be a couple of huge tables. I was also thinking that I could sum/min/max rows of data by minute/ho...

Achieving better DB performance

I have a website backed by a relational database comprised of the usual e-commerce related tables (Order, OrderItem, ShoppingCart, CreditCard, Payment, Customer, Address, etc...). The stored proc. which returns order history is painfully slow due to the amount of data + the numerous joins which must occur, and depending on the search pa...

Is there a tool which will import javadoc into a SQL DB?

I'm making the leap that if it's pretty straightforward to generate XML for Javadoc, then it's pretty straightforward to extract records with xpath etc... and then import those into a database in order to create your own searchable and linkable structures... I've done the straightforward Google searches (or at least I thought I had) -- ...

Logging SQL in Weblogic Server 8.13

Hi, I am trying to print out the SQL statement that my EJB uses to create record in the database into a log file. Does anyone have any experience to do this. thank you. Cheers, ...

question for h2 which is faster?

now I have two choice. I have the same schema for all the data. the record stand for the connection between to hosts.So one record belongs to two hosts. now I do the action that once I need to get the connection of 1 host. I will insert the record in to h2. So if there is a connection between host1 and host2. Everytime I query the conne...

slow query log analyzers

What kind of tools are available to read & interpret slow queries and missing indexes? I am aware of MySQL Query Analyzer, can you suggest other tools which are simpler to configure and maintain (both open source and commercial) Database environment: MySQL, H2 ...