database

What are ways to move data older than 'Y' days to an archive/history table in MySQL?

Looking to move data from a table A to history table B every X days for data that is Y days old and then remove the data from history table B that is older than Z days. Just exploring different ways to accomplish this. So any suggestions would be appreciated. Example for variables X - 7days Y - 60days z - 365days Thank you ...

Extreme wait-time when taking a SQL Server database offline

I'm trying to perform some offline maintenance (dev database restore from live backup) on my dev database, but the 'Take Offline' command via SQL Server Management Studio is performing extremely slowly - on the order of 30 minutes plus now. I am just about at my wits end and I can't seem to find any references online as to what might be ...

Access db loop - for each record in one table create array of records in another table

Is it possible to create a nested looping query in Access DB that will update a third table? I have a master (header) table: ------------------------ masters ------------------------ num | modality | cost | ------------------------ 01 | thing | 23.00 | 02 | thing | 42.00 | 03 | thing | 56.00 | 04 | apple | 11.00 | 05 ...

storing images in db and map them with nhibernate

how to store images in db and map them with nhibernate ...

PostgreSQL how to create a copy of a database or schema?

Is there a simple way to create a copy of a database or schema in PostgreSQL 8.1? I'm testing some software which does a lot of updates to a particular schema within a database, and I'd like to make a copy of it so I can run some comparisons against the original. ...

Why would you "store instances of the class in the database as entities"?

I'm trying to understand a line from the Google Datastore API which says: JDO uses annotations on Java classes to describe how instances of the class are stored in the datastore as entities, and how entities are recreated as instances when retrieved from the datastore. I'm sure this is a very basic question for most peopl...

How can I optimize this query?

How can I optimize this query? It seems there should be a much easier way to do this. The goal is that it will still be able to be readily turned into a delete statement. SELECT * FROM team WHERE team_id IN ( SELECT team_id FROM ( SELECT team.team_id, ( ...

Problem Using JApplet that Accesses a Database on a Web Application Using Netbeans 6.5.1

I created a JApplet using Netbeans 6.5.1 that accesses a database. When the program is run by itself, it runs perfectly. The issue is when you try to put it online using a web application in Netbeans, it will not access the database. I was told by somebody that the problem is that Java security will not allow you to do this. Is this ...

How to Handling Incremental Load with large datasets ssis

I have 2 tables (~ 4 million rows) that I have to do insert/update actions on matching and unmatching records. I am pretty confused about the method I have to use for incremental load. Should I use Lookup component or new sql server merge statement? and will there be too much performance differences? ...

A good architecture for Tagging items

Duplicate: How do you recommend implementing tags or tagging What's a efficient, fast and elegant architecture for a tagging system (such as posts or photos). For example, you have a site like StackOverflow and each item has a couple of tags. What's the best way to keep track of these, and make them searchable. Scalability is impor...

After creating a new row in the database, should I return the primary key to the row or a data transfer object?

I have a three tier system, SQL Server backend, hand written data access layer, and using stored procedures. I have a table called EventTable. Each row is an 'Event'. An Event has a primary key, and a start date. CREATE TABLE EventTable ( ID INT IDENTITY(100,1) PRIMARY KEY, StartTime DateTime NOT NULL ) There is a stored proced...

How to prevent deletion of the first row in table (PostgreSQL)?

Is it possible to prevent deletion of the first row in table on PostgreSQL side? I have a category table and I want to prevent deletion of default category as it could break the application. Of course I could easily do it in application code, but it would be a lot better to do it in database. I think it has something to do with rules o...

How to create a page to edit a database

I'm trying to build a website that provides a login for users. Once these users login, they will be able to perform functions that will likely query a database. At some point I will need to add/modify/delete contents in the database and I'm wondering how I would be able create a page on the website that I'd only have access to. Ideally I...

Without joins on Google App Engine, does your data have to exist in one big table?

Since Google App Engine doesn't permit joins, does this mean that I have to take all of the tables in my web app and figure out a way of combining them into a single huge table? ...

Php Db schema diagram creator

Hello, Wondering if there is any php script out there which takes an sql db and diagramatically shows the entire thing (along with relationships)? Similar to what most mysql tools offer for desktop. Thank you very much. ...

Delphi - Network ODBC Database (MS Access)

Hello everyone. I have a Database program which uses MS Access. The time has come and I need to make it a client/server app. The idea behind the scheme is: Server holds the database, and one or multiple clients need to access it simultaneously. The program will still need to operate under Ms Access (because porting DB and rewriting the...

Sqlite and Python -- return a dictionary using fetchone()?

I'm using sqlite3 in python 2.5. I've created a table that looks like this: create table votes ( bill text, senator_id text, vote text) I'm accessing it with something like this: v_cur.execute("select * from votes") row = v_cur.fetchone() bill = row[0] senator_id = row[1] vote = row[2] What I'd like to be able...

Problematic data patterns, performance-wise

Assertion: the performance of SQL databases degrades when the volume of data becomes very large (say, tens or hunderds of terabytes). This means certain patterns in database design which are reasonable for most small-to-medium sized databases break down when the database grows. For (a rather general) example, there is a trend that moves...

Preventing Duplicate Keys Between Multiple Databases

I'm in a situation where we have a new release of software coming out that's going to use a separate database (significant changes in the schema) from the old. There's going to be a considerable period of time where both the new and the old system will be in production and we have a need to ensure that there are unique IDs being generat...

How to set a database in emergency mode?

my database is stoped. i can't make anything, select, update, nothing. somebody told me to set the database in emergency mode but i don't know how? ...