database

Tricky SQL SELECT Statement

Hello, I have a performance issue when selecting data in my project. There is a table with 3 columns: "id","time" and "group" The ids are just unique ids as usual. The time is the creation date of the entry. The group is there to cummulate certain entries together. So the table data may look like this: ID | TIME | GROUP -----...

What would you do to avoid conflicting data in this database schema?

Hi, I'm working on a multi-user internet database-driven website with SQL Server 2008 / LinqToSQL / custom-made repositories as the DAL. I have run across a normalization problem which can lead to an inconsistent database state if exploited correctly and I am wondering how to deal with the problem. The problem: Several different compa...

Can my oracle still be used by end user when a crontab job update the database?

I have a crontab job run at 00:00 to update my website database every night; To prevent the job from brreaking end user's operation on website, should I stop my website during the job is running? Is there any better alternate course? Thanks in advance! ...

C# Code generator that can speeds up the development of a DB driven software?

Hi, I'm new to c# and .net development. I'm looking for a C# code generator that can generate the code for CRUD operations and entity objects against tables in a database. It needs to be: Support Oracle database; The generated code must be simple and easy to use. Thank you very much in advance! ...

When would you ever set the increment value on a database identity field?

Given the table: CREATE TABLE Table1 ( UniqueID int IDENTITY(1,1) ...etc ) Now why would you ever set the increment to something other than 1? I can understand setting the initial seed value differently. For example if, say, you're creating one database table per month of data (e.g. Table1_082009, Table1_092009) and want to s...

Store user information in session?

Should you store info about the user required for each request eg. Role, email, username etc. in Session, or is ok to goto the database each request for this information?? Thanks ...

Oracle UPDATEs to Certain Table Hang Indefinitely

I can update some tables just fine, but a certain table I have cannot be updated by either my ASP.NET application or SQLPLUS. Both hang indefinitely. I have to forcibly quit SQLPLUS. I have update statments both in standard OracleCommand objects running a: cmd.ExecuteNonQuery(); but I also have asp:SqlDataSources bound to a GridVie...

how to get current datetime in SQL?

Want to get current datetime to insert into lastModifiedTime column. I am using MySQL database. My questions are: is there a function available in SQL? or it is implementation depended so each database has its own function for this? what is the function available in MySQL? thanks, ...

SQL Server child/parent record deletion error

We have a database housekeeping operation that the SQL Server agent runs overnight (SQL Server 2005). Basically it compiles a table of record ID’s that are old enough to be deleted and then first deletes any child records before deleting the main record. Recently after adding a new table dbo.IssuePrice, which has a foreign key reference...

Firebird database schema/data difference tool

RedGate makes a tool for Microsoft SQL Server that allows you to snapshot the difference between two databases. It generates the scripts needed to update the database schema while preserving the data. I need to find a tool like this for the Firebird database. We use Firebird in an embedded fashion, and would like to push out schema upd...

trying to understand ebay's schema

I want to build a site similar to ebay (a mini version of it, using a LAMP stack as the basic setup I guess or maybe you guys will suggest something else) and I'm wondering how they built their system. The part I don't understand the most is how they manage their categories. They have one search code and probably one code for posting ite...

Storing Images : DB or File System -

Hi all, I read some post in this regard but I still don't understand what's the best solution in my case. I'm start writing a new webApp and the backend is going to provide about 1-10 million images. (average size 200-500kB for a single image) My site will provide content and images to 100-1000 users at the same time. I'd like also to...

Pivot Table vs Parent_ID for 1-Many Relation

In a general one-to-many (parent-to-child) relationship, is there a significant efficiency difference between (a) putting parent_id in the child table and (b) using a pivot table of only parent_id, child_id? NOTE: Assume Oracle if necessary, otherwise answer using a general RDBMS. ...

Syncing permissions between a Database project and a database using Visual studio

I have a database project in visual studio (2008) that I am using to keep my database structure in a version control system (Git). I use the data schema compare tool in VS to maintain this database project. The issue that I'm encountering is that I keep losing my permissions for new objects. So how do I: Capture these permissions u...

How to handle multiple one->many relationships?

I have a database with several tables, 5 of which are dedicated to specific publication types. Each of these 5 have a one->many relationship with a status table and a people table. All of these tables are tied together using a unique "pubid". I have a view which includes the pubid (for all 5 types), along with their associated keyword...

WPF -- trap database connection errors from ObjectDataProvider

I've got a WPF application that uses LINQ to SQL DataContexts. The first call to the database would be from the ObjectDataProvider in the XAML of the main form: <ObjectDataProvider x:Key="WaitingPatientDS" ObjectType="{x:Type local:clsPatients}"> <ObjectDataProvider.ConstructorParameters> <sys:Boolean>True</sys:Boolean> ...

CREATE OR REPLACE VIEW sql error

Trying to update a table view using: CREATE OR REPLACE VIEW [vtable] AS SELECT * FROM Files_Table ORDER BY File The table is returning the old view, not the updated. Statement tested in the Sqlite database browser: Error message from database engine: near "OR": syntax error but didn't get this in the program? Any idea why i...

Hibernate 'tableless' enum mapping?

I am dealing with the following scenario: We use table-per-subclass inheritance, meaning the concrete tables' primary keys are foreign key references on the abstract table. Superclass is Product, subclasses are Book, DVD, AudioCD, ... Now in the Java superclass, say Product.java, we have an enum of the types of products: book, dvd, mu...

How does DB connection pooling work for webapps if HTTP connections are stateless?

Hi all! Here is something I can't understand. A lot of web frameworks internally use db pooling. I can't understand how the db pooling can work there, if HTTP connections are stateless? I can imagine that db pooling could work only for connections that are Keep-Alive? Any ideas? Thanks! ...

Allowing users to bump an input they submitted every hour?

So, I want people to be able to "bump" what they've wrote in my database but at the same time only allow the input to be in the table ONCE at a time. For Example: Jim's code is 5555. Jim enters his code and it shoots to the very bottom of the table. After 34 minutes he tries to enter his code in again (Because various other people h...