database

Show SQL log on a separate monitor

I have an idea of monitoring all SQL queries on a spare monitor which is almost not used in my daily coding. You can see latest SQL queries in runtime. Obviously this is not unique. But I just want to know your opinion on this. Can this approach be useful? Can it help to detect a problems in your SQL queries faster? Can it help you in ...

Using scope_identity() with ASP.NET controls

I've built a form for entering some data into a table in my database, now I want to INSERT that data, and get back the ID (which is an autonumber) of the record that has just been added. I've got the INSERT part working just fine, and I've tacked "SELECT SCOPE_IDENTITY();" onto the end of that, but now I need to retrieve the returned num...

Which method should I go with; Indexing MySQL db with SOLR

I have a classifieds website, with approx 30 categories of classifieds. I am on the stage where I have to build MySQL tables and index them with SOLR. Each row in a table has around 15 fields... I am looking for performance! I wonder which of these two methods works best: 1- Have one MySQL table for each category, meaning 30 tables, ...

Pros and Cons of Triggers vs. Stored Procedures for Denormalization

When it comes to denormalizing data in a transactional database for performance, there are (at least) three different approaches: Push updates through stored procedures which update both the normalized transactional data and the denormalized reporting/analysis data; Implement triggers on the transactional tables that update the seconda...

Good in-memory database for .net/PowerShell?

If I have a script that handles state information that's a bit more complex that can be stored in variables, what's the best option for a small in-memory database? Sqlite is an option, though that would be an external dependency. XML might do, though it's non-relational. Is there any consensus on a tool for this job? ...

I need to generate a file from binary information in sql........

I am writing a windows desktop application in visual basic and I need it to connect to a SQL database, take a rows unique id, and using that number generate a file from the binary data that is stored in the SQL database and save it to a file directory. The part that is hanging me up is the creating the file from the binary SQL data. ...

ETL framework for loading data into Rails app

I need to load data for my Rails application from multiple providers (REST/SOAP based XML feeds) into the database on a recurring basis. I have written a set of Rake tasks which are kicked off by whenever-generated cron jobs. Each task hits the partner feed endpoint, parses the feed and loads it into the database. Instead of writing Rak...

Hibernate: Check if object exists/changed

Assuming I have an object Person with long id String firstName String lastName String address Then I'm generating a Person-object somewhere in my application. Now I'd like to check if the person exists in the database (= firstname/lastname-combination is in the database). If not => insert it. If yes, check, if the address is the same....

Oracle Select Syntax into Postgres

I am converting Oracle Syntax into Postgres SELECT MSN_INT_ID, MO_INT_ID, 'Y' "AIRMOVE" FROM MISSION_OBJECTIVE WHERE MO_MSN_CLASS_CD = 'AMV' GROUP BY MSN_INT_ID, MO_INT_ID This part is confusing me: SELECT MSN_INT_ID, MO_INT_ID, 'Y' "AIRMOVE" What is the 'Y' "AIRMOVE" doing? ...

Why this code fails in PostgreSQL and how to fix it (work-around)? Is it Postgres SQL engine flaw?

I've been working on text parsing task when I found strange Postgres behavior. My original code exposing strange error was written in Java with JDBC connectivity for PostgreSQL (v8.3.3 and v8.4.2 tested), here is my original post: Is it an error of PostgreSQL SQL engine and how to avoid (workaround) it?. I've just ported my Java code giv...

How to assert that database connection is in a transaction?

I'm using an object/relational mapper to talk to the database. The library in my case is iBatis which is also used for transaction management. However, I recently had a case where iBatis didn't actually start a transaction even though startTransaction() etc. was called as documented. After some debugging I found out that there was a conf...

What is the preferred way to store custom fields in a SQL database?

My friend is building a product to be used by different independent medical units. The database stores a vast collection of measurements taken at different times, like the temperature, blood pressure, etc... Let us assume these are held in a table called exams with columns temperature, pressure, etc... (as well as id, patient_id and ti...

:autosave property of has_many associations broken in Rails 2.3.4?

Before I post this as a bug to the rails team, I wanted to see if I'm doing something wrong that may be causing this behavior. Specifically, the :autosave property of has_many associations doesn't seem to be working as per the docs. For reference, here is the most current API documentation: http://api.rubyonrails.org/classes/Acti … ati...

SQL Server 2008 & Visual Web Developer 2008 express editions: Connection to DB Fail!

So I saw this question/comment... http://stackoverflow.com/questions/1625991/how-to-integrate-sql-server-2005-express-edition-to-visual-web-developer-2008-exp/1626114#1626114 And this is EXACTLY what I am having trouble with, only using SQL Server 2008 express edition and Visual Web Dev 2008 express. Everytime I try to click to add a ...

What is the most clever and easy approach to sync data between multiple entities?

In today’s world where a lot of computers, mobile devices or web services share data or act like hubs, syncing gets more important. As we all know solutions that sync aren’t the most comfortable ones and it’s best not to sync at all. I’m still curious how you would implement a syncing solution to sync between multiple entities. There ar...

How to implement database functionality effectively?

I am developing a Java Desktop Application which uses MySQL database. The DB has 6 tables. Every table, as usual, should allow CRUD (Create, Read, Update and Delete) operations. I have designed 6*4 = 24 JPanels, 4 JPanels for each tables. Each JPanel have Components to take user input and perform the CRUD operation for which it is desig...

Is there any tool/SW to help me build a good database ?

I am new to databases. I have a classifieds website with MySQL db and I am soon about to use SOLR to index them also. Then whenever a query is done, SOLR will return ID:s and I will match those ID:s to the MySQL database and fetch the ads to display. Anyways, I have trouble making the db. Users may choose from a drop-list what category...

database design and performance

Hi all, I have some question regarding database performance in general. I'm using Sqlite but I assume that the performance remarks are applicable to all relational databases? I have a database that contains a table that stores data of about 200 variables. I write about 50 variables per second to the table. A writen variable contains th...

user activity database structure

Hello. I am working on a community website. I want to show the user's activity in 2 places in the website. The User "A" Profile. The Friends page of the user "A" friends. "What are your friends doing?" The tables for instance are: members members_gallery members_videos members_friends my problem is in the Sql structure. I've ...

How to find largest objects in a SQL Server database?

How would I go about finding the largest objects in a SQL Server database? First, by determining which tables (and related indices) are the largest and then determining which rows in a particular table are largest (we're storing binary data in BLOBs)? Are there any tools out there for helping with this kind of database analysis? Or ar...