database

How would you create and store user-defined custom fields in a SQL database?

I need to allow users to add new fields to a record, e.g. if there is a Contact record, a user may want to add a "SSN" numeric field and a "Birthdate" date/calendar field. They would do this through the UI of course. Those fields should then be available for entry for all contact records. Considering that my application runs for many ...

Avoid Database Dependency For Unit Testing Without Mocking

I've got many objects with methods that require database access. We're looking to get into unit testing but are keen to avoid the use of mock objects if possible. I'm wondering if there is a way to refactor the Validate method shown below so that it wouldn't need db access. In the actual application there is usually a fair bit more going...

Indexing databases

if we make an index on the primary key of a table how would it increase performance ,,,,as if the desired record afer creating the index might turn up in the end of the index list!! ...

Problem writing this query in mysql (marking read messages in a forum)

Hey. i am writing a forum, and i have this table that marks messages a specific user read: `read_messages`(`message_id`,`user_id`) a simplified version of the messages table: `messages`(`id`,`forum_id`,`author_id`) now, i want to be able, when retrieving the message data from the database for a given forum, to add a variable that w...

Is this possible with Subsonic

I need to generate Entities/Object from selected tables - not all. Is this possible with Subsonic and if so how? ...

Using MS Synchronisation framework with J2EE webservices to provide offline .Net client application feature.

I use a glassfish server to expose (METRO / WSIT) webservices that handle entity database accesses. I would like to know if someone tryed to use MS Sync Framework with this configuration to enable offline .net client feature. Thanks for incoming anwsers. ...

Webappas using client side XML database.

I am thinking for a new approach to make small webapps using XML. Here the the procedure to make it. First of all design a DataBbase for Application. This database is the soul of your application. This database contain all the necessary data and values. Now when a user requests to this webapp, the server will execute a server side scrip...

SQL Server Client App

I'm designing a database for internal use at my company that will store data that is produced by my team members. While SQL Server will be installed only on a single server machine, my team members will need to be able to access the data and run filter/select queries on it from their own terminals (for instance, search for the product fr...

Should I allow null values in a db schema?

I know that logically, there are some cases where NULL values make sense in a DB schema, for example if some values plain haven't been specified. That said, working around DBNull in code tends to be a royal pain. For example, if I'm rendering a view, and I want to see a string, I would expect no value to be a blank string, not "Null", an...

Best practice using XML and XSD's to map against database

We have a ReST Web Service that uses POST - to insert data into database (unmarshall data from XML), and GET to retrieve data (marshalled into XML). An XSD is used to generate Java objects (via Sun's JAXB compiler) to marshall/unmarshall data to and from a database. We kind of froze the XSD as it is, because we thought this models the...

Is it faster to normalize this table?

I have two tables, like these: Table People: VARCHAR Name INTEGER Age Table Message VARCHAR Message VARCHAR Name There are hundreds of insert and delete going on with the Message table with queries like this: insert into Message VALUES ('Hello there', 'John'); delete from Message where name = 'John'; My question is, is it worth whi...

MS-Access pivot columns

I create an MS Access 2007 query where the same customer has multiple project and data appear like: 1 | Foo 1 | Bar 1 | Baz 2 | For 3 | Cad 3 | Cam and I want to transform it into something like 1 | Foo | Bar | Baz 2 | For | 3 | Cad | Cam | The goal is to create a spreadsheet view per customer (1,2,3) which can be read from word...

Modeling: Xml vs. Relational Database

I am wondering if there are best practices for deciding between when a system should be modeled using XML and when it should be modeled using a relational database (I know you can store XML in a database, but there is an enormous difference between modelling a system using normalized db tables and modelling a system using XML-Schema). F...

How to partially migrate a database to a new system over time?

We are in the process of a multi-year project where we're building a new system and a new database to eventually replace the old system and database. The users are using the new and old systems as we're changing them. The problem we keep running into is when an object in one system is dependent on an object in the other system. We've b...

SQL Permissions / Securables - Can I give permissions to a "Select" from a View that uses another View that doesn't have permission granted?

Here's my scenario... SQL Role Staff_User Scheme People Tables People.Persons People.PhoneNumbers Views People.vtPersons - The vtPersons view filters the data from the Persons table showing only that which belongs to the currently logged in user. People.vtPhoneNumbers - The vtPhoneNumbers view filters the data from the P...

identity_insert and table initialisation script

i am trying to create a table with a row where id=0 but the identity insert column starts at 1,1 so all following use the identity insert i have to execute DBCC CHECKIDENT ('Foo', RESEED, 0); after i manually insert (using a script) to get the next row to have id=1 is there another way to get id=0 for my first row which is from the i...

Serverless Database in C#

Complete newbie question here: I'm just playing with C# for the first time and want to make a Windows Forms application which stores some info in a database structure, but obviously don't want to require something like MySQL to be installed on each client's computer. How do I go about this? ...

dba_jobs_running: table or view does not exist when trying to access from procedure

Hi Folks, Simply querying running jobs using something like select * from dba_jobs_running; works fine when executed in my sqldevelopers SQL console. However, it does not work, when having exactly the same statement within a procedure. Compilation fails with PL/SQL: ORA-00942: table or view does not exist Any ideas? Is there so...

How to get an AutoNumber from DataTable AutoIncrementColumn with a Strongly-Typed Database in c#?

I have added a strongly-typed Database (MySQl) to a C# (.net 3.5) project. The database (DB.Electrophysiology_Data) has several relational tables but basically I want to add a new 'filesRow' to the 'files' table. I use something like the following code. DB.Electrophysiology_Data.filesRow new_file = ds.files.NewfilesRow(); ...set the va...

What's the best way to keep decryption key for decrypting encrypted database?

I have a encryted database and decryption key. How to keep decryption key away from hacking(Both database hacking and unauthorizated accessing PC.)? Hardcode in assembly. keep in registry. keep in RAM. Moreover, I need algorithm for encryted data. What's the best algorith for doing this in security per decryption time term? RSA AES...