database

Storing user variables in database vs session in asp.net

Hello, I'm working with an asp.net application that stores most data in a database and not session. I'm wondering of the pros and cons of each and which is the better way to go. For example, you have a pretty busy site and instead of storing user specific variables in session, there is a DB table called user data and it can store all use...

MySQL: hourly average value

Hello, I have a table with a 'timestamp' column and a 'value' column where the values are roughly 3 seconds apart. I'm trying to return a table that has daily average values. So, something like this is what i'm looking for. | timestamp | average | | 2010-06-02 | 456.6 | | 2010-06-03 | 589.4 | | 2010-06-04 | 268.5 | etc... ...

How should we capture the database user when using the entity framework on a middle tier?

We are developing a service layer for a new system that will handle all interactions with the MSSQL (2005) database. We are a bit perplexed as to how to capture all of the 'who done it' information that is required by our users in some of our legacy audit tables. While we could pass in the users name that was modifying data and log the...

Under what conditions would SELECT by PRIMARY KEY be slow?

Chasing down some DB performance issues in a fairly typical EclipseLink/JPA application. I am seeing frequent queries that are taking 25-100ms. These are simple queries, just selecting all columns from a table where its primary key is equal to a value. They shouldn't be slow. I'm looking at the query time in the postgres log, using the...

Generating a XSD file from Powerdesigner

Is there a simple way to make Powerdesigner generate an XSD file? It generates an XSM file, but it's not the same specification. If there were a simple way of doing it, it would ease my life as heaven :P. ...

Count associations in sqlite database query?

I have a sqlite database with three tables: Notes, Lists, and Notes-in-Lists. Both Notes and Lists have an autogenerated id column and some extra data columns like title. Notes-in-Lists is an association table with an autokey, and two foreign keys that point to a Note id and a List id. I have a query that returns all notes in a given l...

Raw Binary Tree Database or MongoDb/MySQL/Etc ?

I will be storing terabytes of information, before indexes, and after compression methods. Should I code up a Binary Tree Database by hand using sort files etc, or use something like MongoDB or even something like MySQL? I am worried about (space) cost per record with things like MySQL and other DB's that are around. I also know that ...

Modeling products with vastly different sets of needed-to-know information and linking them to lineitems?

I'm currently working on a site that sells products of varying types that are custom manufactured. I've got your general, standard cart schema: Order has many LineItems, LineItems have one Product, but I've run into a bit of a sticking point: Lets say one of our products is a ball, and one of our products is a box of crayons. While peop...

Retrieving information from aggregated weblogs data, how to do it?

Hello, I would like to know how to retrieve data from aggregated logs? This is what I have: - about 30GB daily of uncompressed log data loaded into HDFS (and this will grow soon to about 100GB) This is my idea: - each night this data is processed with Pig - logs are read, split, and custom UDF retrieves data like: timestamp, url, user_id...

Primary key question.

Is there a benefit to having a single column primary key vs a composite primary key? I have a table that consists of two id columns which together make up the primary key. Are there any disadvantages to this? Is there a compelling reason for me to throw in a third column that would be unique on it's own? ...

Is there any method to share database in iphone?

I want build a app, in that app i should able to shear my database with every one. Is there any method to do that? ...

Connect to IBM DB2 with .Net using only .dll reference

I would like to connect to a DB2 database, specifically an iSeries version, using .Net and C# by referencing a .dll and NOT installing any software on the server. Currently we use the IBM.Data.DB2.iSeries.dll, which is installed as part of iSeries access for windows. I don't want to have to install all of that. But apparently I don't hav...

SQL Server - Database 'Database' does not exist. Make sure that the name is entered correctly.

Hi, I'm trying to generate my database tables from my Entity Framework model, but I'm getting this error when I execute the generation query: Database 'Database' does not exist. Make sure that the name is entered correctly. I'm able to connect to the local server just fine. My connection string, which was generated by VS when I sele...

MySQL: ERROR 1054 (42S22): Unknown column in 'where clause'

I'm doing some changes on a WordPress database. I need to replace the URLs in the GUID field on the wp-posts table with the URLs coming from another table called ebdurls. The description of the tables is as follows: wp_posts: the field type for the two fields I need are: ID -> bigint(20) unsigned guid -> varchar(255) And the table w...

T-SQL - create new foreign key relationship from non-normalized data

I am trying to figure out the best Transact-SQL to transform non-relational tables into tables that are more relational, and support foreign keys. Suppose I have a table FRUIT Id Name USState 1 Apple Washington 2 Pineapple Hawaii 3 Orange Florida 4 Peach Georgia etc I want the ...

Image control from Database in VB6

I have some images stored in a database and I want to populate an image control. All the examples I can find copy the image to the hdd and then use loadpicture to put it in the image control. Is there a way to push the image directly in without going to the hdd first? ...

How do I find the next record in an ActiveRecord set?

I am working in Padrino and have this in my controller @work.find_by_id(params[:id]) I want to add prev/next buttons into my view, and so must be able to get the path to the next item on the list. How can I do that with ActiveRecord? ...

Easiest way to use SQL in a C# application?

I'm making an application in C# (with Express Edition) for which I would like to add some SQL functionality so that the user can query a database. I don't care how or where I store the database. I can store it in a DataTable or a bi-dimensional array or any kind of file. But I want the user to be able to SQL-query it. Apparently this sho...

SQL audit recommendation

I am working on creating audit policy for SQL server tables for my application. I need to track all the insertion/updation/and deletion operations on the tables so that this can be used for the audit reports. I am planning to create audit table with the same structure for each table and define triggers on the main table to populate the a...

Count projection from criterion

I'm trying to write a query that takes a criterion and returns a count projection, this is what i'm using at the moment but it's really inefficient, why ideas on how I can replace this? /// <summary> Each criteria contributes one row </summary> private IProjection AsCount( ICriterion criterion ) { if (criterion == n...