database

Help with Supertype/Subtype? (and categories..)

I have a service table. Each service is defined by 1 main category and 1 sub category. For example, Service = Joe's Web Company, MainCategory = Information Technology, SubCategory = Web Development Each service offered will have a common set of properties (cost, location etc) Each service will also have a set of attributes specific...

mysql length limits

I am changing my db so that certain fields can be longer. Right now they're "varchar(255)" can I just increase that to "varchar(500)" or are there special rules for dealing with this and I should make them "text"? ...

Inserting Record into database using Javascript!

Hi Is it possible to insert data in a database using javascript only. if yes then please post a simple example of it. Since javascript is a client side language and not a server side,i think its not possible. But then how to do it. ...

Converting data from nvarchar to varchar in C#

As part of an integration task I am doing, I have a column in my database that has the type nvarchar(30) and I need call a WCF service and pass through the values in this column (among others) that will then be stored in a column that has the type varchar(30) in the other database. What should I do (presumably in the code that calls the...

Using DbConnection.GetSchema() to retrieve all but System Dbs

I am using DbConnection.GetSchema("Databases") to retrieve a list of databases from a given connection, and that works as expected. However i want to sort out the system db's from this list, as they are not valid for what i intend to do with this list. Does anyone know a way to do this? ...

DB schema question, products types

My question is how to model transactions for different types of products. So there is a Transactions table: TransactionId(pk) Amount Method AuthorisedBy(fk) And there are different tables for different types of products. Books table: BookId(pk) Name Description Price And a Pens table: PenId(pk) Color Description Price And a tab...

Should I use a flat file or database for storing quotes for a random quotations app on Android?

Hi, I am developing an app on Android that will randomly pick and display an inspirational quotation (or verse) from a large collection of quotations. On Android I can choose between a flat file and an SQLite database. The app should satisfy the following conditions: Be scalable to 10^6 quotations and/or verses Be very fast (i.e. re...

Database maintenance with SSIS or T-SQL?

Is there any benefit to using SSIS over T-SQL to check integrity, defrag/rebuild indexes, and backup databases? Doesn't SSIS break down its internal tasks and containers into basic T-SQL statements anyways? ...

HABTM-Relation : Create a relation for all other records

Hi! If i want to add a record to TABLE A, is there an efficient way to add a record in the JOIN TABLE for many (or all) records in TABLE B? I try to build a simple task management (in CakePHP). An user adds a task and there will be added a connection to each other user in the same group as the current user. At the moment, I use th...

What are best database-modeling tools available in general and specifically for MySQL ?

Hi, I have tried searching other SO Questions but not found the answer am looking for and so am posting question here. My question is regarding what are the best database modeling tools available in general and what database modeling tools are available specifically for MySQL Database. Thanks. ...

integer primary key for replication

I am weighing my options for integer primary keys that can be used in multi master replication. (I'm pretty much sold on using integer keys instead of GUIDs) The best I can come up with is having the most significant data first and having the server number last: eg. invoice 1 on server 1 = 101 invoice 1 on server 2 = 102 where the non s...

How to do Inheritance Modeling in Relational Databases ?

Hi, My question is regarding Inheritance modeling in Relational Database Systems. I have canonical data model and in that I have some fields related to pricing of product inheriting certain attributes from product table and I want to model this inheritance in MySQL relational database and so, "How can we do Inheritance Modeling in Re...

Cascade a value in a table

Lets say I have two tables, 'a' and 'b'. The relationship of 'a' to 'b' is one to many. Lets both tables have the field status. This field has the values 'active' and 'inactive'. If I set the field status to 'inactive', does MySQL have a way to cascade this down to all tables tied to the row I changed the status value for? Or would ...

Cannot connect to DB after I uploaded website to a host

I have upload my website to a shared hosting, set-up everything and my asp.net 3.5 app won't connect to SQL Server database on the shared hosting provider. This is the error I get: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify...

What are the general guidelines and best practices to keep in mind while designing database for an application ?

Hi, My questions is regarding Database Modeling. I tried to look for this question amongst other Database Designing questions on SO but haven't found it and so here am asking about: What are the general guidelines and best practices to keep in mind while designing database for an application ? What are the best resources/books/Univer...

Calling custom PHP inside Drupal

Drupal version 6.12 I have a page whose input format is PHP. I simply want to update a database table. The SQL code appears to be too complex for db_query. I can not make db_query work nor does including php nor does dropping custom php code into the “Body” seem to work either. Any advise on how I can make the following code work in...

GROUP_CONCAT and DISTINCT are great, but how do i get rid of these duplicates i still have?

hi, i have a mysql table set up like so: id uid keywords -- --- --- 1 20 corporate 2 20 corporate,business,strategy 3 20 corporate,bowser 4 20 flowers 5 20 battleship,corporate,dungeon what i WANT my output to look like is: 20 corporate,business,strategy,bowser,flowers,battleship,dungeon b...

Transferring DNNdatabase from local to production

Hi, I creaed one dnn applicaiton, and the source is moved to production and also same as the database is also moved to production server, but i am getting the dotnetnuke error. I think there is a database not inserted correctly. Can you help me how to transfer the database from local to production.. ...

When backing up a postgres database I get prompted for a password

I'm busy backing up my postgres db, I run the following command pg_dump -d data -U postgres -h 127.0.0.1 -CdiOv > data.sql I however have one problem I get asked for the password, if I want to add this into a cron I do not want to get promted for the password. Is there any way to do this without the password prompt? ...

Ways to create a huge inverted index

I want to create a big inverted index of around 106 terms. What method would you suggest? I'm thinking in fast binary key store DBs like Tokyo cabinet, voldemort, etc. Edit: I've tried MySQL in the past for storing a table of two integers to represent the inverted index, but even with the first column having a db index, queries were very...