database

Defining table structure for a database?

Up until now, my experience with databases has always been working with an intermediate definition layer that we have where I work. i.e. SQL wasn't directly written for the table definitions, but generated from an intermediate file which wrote out SQL scripts for creating the appropriate tables, upgrade scripts between schema changes, a...

Can Linq to Sql (L2S) update a database when a class/property is added to the DBML?

I have a small L2S database that was generated with the L2S CreateDatabase command. When I add a class or property to the DBML, the database is not updated automatically. I get errors like "Table not found" at runtime. Is there a way to add new tables and columns to a database? ...

Django South: Creating schemamigration for more than one app

I'M using django south on a bigger project, the only thing I don't like about it, that you can't create schemamigrations for all of your apps at once (I have a lot of apps that inherit from the same abstract model, if I change that base model there are alot of apps to migrate) - thought you can actually migrate all of them at once (usin...

How does one implement a MySQL database into a webpage?

I am a complete database newbie. So far, I know that I can connect to MySQL using PHP's mysql_connect() command, but apart from that, I really don't see how to take that data and put it onto a web page. a) are there ways other than mysql_connect() b) lets say I had a table of data in mysql and all I wanted was for that table (for examp...

How to deploy a dbproj in vs2010?

Quick question, I'm new to dbproj, how do you actually deploy it to my sqlserver from vs2010? I built the dbproj, and it created a bunch of files in sql/debug folder, then what do I do? ...

Is it better to model databases after their applications, or after their components?

I'm structuring a database, and found that I have two different objects I'm trying to model. Each one consists of the same things (a varchar and a couple of foreign keys), and will do so for the forseeable future. I'm (as of now) going to put them in the same table, with an extra 'type' field, but I was wondering if there's standard pr...

Find package dependencies from database table

I have two tables in a database, one lists package and one lists dependencies: packages id | name --------- 0 | xorg 1 | gnome-session 2 | gnome-panel 3 | gnome-mixer-applet 4 | gnome-media depends package | depends ----------------- 1 | 0 2 | 1 3 | 2 4 | 2 Obviously, if I want to find out what a packag...

Can you bypass the size limit of SQL Server Express by stacking databases?

My company is working on a development project using SQL Server 2008 Express. The amount of data we plan to store in our main table will quickly exceed the 4GB size limit of Express. We can buy ourselves some time with SQL Server 2008 R2, but eventually we will surpass the 10GB limitation as well. The team lead wants to hear all availab...

Can a table field contain a hyphen?

I have a table in a MySQL table with a fieldname 'product', and want to rename it to 'ds-product'. The CMS type system I am using uses the id of formfields as the name of the table field to insert into. For most this works fine, but for a particular field it prepends 'ds-' to whatever ID I give it, so I must make the table field name m...

Which framework and database should i use?

I am looking at creating an application to record gym workout(set,reps, etc) and I was wondering what framework and database backend to use. I am currently thinking C# .Net 3.5 for the framework because I am familiar with it but I'm unsure about how to store the data. Originally I was thinking of xml files and parsing through them but th...

Are there advantages to using foriegn key constraints when working in an active record framework like ruby-on-rails?

I'm moving back into full time web development after a 5 year hiatus. My previous experience (no active record or MVC) tells me to be very thorough with my database schema. Foreign key constraints, unique indexes, etc... can really help out when your writing spaghetti code. Does the community still find these useful when working in an...

Can I name my constraints with JPA?

When I use the maven-hibernate3-plugin (aka hbm2ddl) to generate my database schema, it creates many database constraints with terrifically hard-to-remember constraint names like FK7770538AEE7BC70 . Is there any way to provide a more useful name such as FOO_FK_BAR_ID ? If so, it would make it a tad easier to track down issues in the lo...

Database Schema Error

When I use the Data-List object in Visual Studio 2008 while creating a website, and select a data source, after I choose my data source and click OK it gives me this error: I've searched the net and found that: http://social.msdn.microsoft.com/Forums/en/sqlexpress/thread/43357002-3895-4fd4-aee2-59f86d594e70 I Installed the "Microsoft ...

MySQL Categories and Subcategories Table Structure

Hi everyone, I am having a little bit of a problem with setting up a mysql table that will hold a list of categories and subcategories. I am not to sure how to setup the table. Does it need to be 2 separate tables? 1 for the main categories and 1 for the subcategories or can it be all in 1 table? Would something like this work? Create T...

How to connect published Visual C# solution to a different database.

So here's the what's up. I just created and "published" a staff management tool in Visual C#. During development, I used a string saved in Properties.Settings.Default to connect to the database I was using for development. Now since the solution is published and ready to go, the boss wants to connect to the real staff database. I was...

Database design: Is there a way to improve on this design?

Simple question- Below is the database design to hold the following records account TransactionType TransactionName Amount FeeTransactionId TransactionId RefTransactionId Alex [Deposit from] [Credit Card x-1234] [-100.00] b a Alex [Deposit from] ...

Make DataBase portable

I'm developing a local application with a DataBase in SQL Server 2008 and Visual Studio, C#, I created and connected to the Database in the application, but when I pass to work to another computer, copy the all solution files, the information that had been saved in it doesn't exist, actually the entire Database doesn't exist, so I ask: h...

What is a good alternative to SQL Server for ASP.NET applications?

I've been looking into a lot of database's recently, and am not sure if it's because I'm bored or what, but I want to create a few web applications using database's other than MS SQL Server. Any suggestions that tie into ASP.NET nicely? ...

SQLite3::SQLException: Cannot add a NOT NULL column with default value NULL

Hi..I am getting the following error while trying to add a NOT NULL column to an existing table. Why is it happening ?. I tried rake db:reset thinking that the existing records are the problem, but even after resetting the DB, the problem persists. Can you please help me figure this out. Thanks Migration File class AddDivisionIdToProfi...

PHP/MySQL Changing data in a database by clicking a div on the website?

Hi Guys, I have a website that displays a table of a list of people and a value of 1 or 0. If the value is 0 the cell background is green, it ifs 1 its red. How would i make it so clicking the cell will change the value (and therefore colour) and write it to the database? Below is my code. Many thanks, Stephen <? include("dbinfo.inc...