schema

XmlSchema Whitespace collapse: What happens to multiple whitespaces?

I use the following XmlSchema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.test.com/XmlValidation" elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:m="http://www.test.com/XmlValidation"&gt; <xs:element name="test"> <xs:com...

Database schema confusion

I'm having a slight terminology meltdown as I design some classes. In Sql Server 2005, 'schema' refers to a namespace, and an organizational system for database objects. But for relational databases in general, 'schema' means the DDL design of tables, fields, etc. If I'm right about this, it explains a lot of the dissonance when I am try...

SQL Schema to allow users add comments to various tables

So, I'm building a website and I'm going to have standard CMS tables like Article, Blog, Poll, etc. I want to let users post comments to any of these items. So my question is, do I need to create separate comments tables for each (e.g. ArticleComment, BlogComment, PollComment), or can I just make a generic Comment table that could be u...

ADO.NET MVC Tutorial (with LINQ to SQL) question about schema changes

So I'm working through the new scottgu wrox book, and I create a couple tables. Then (per the tutorial) I use linq to sql to build my Models, DataCOntext, Repository, etc. (It's pretty clear that LINQ to SQL seems to be "the Microsoft Way" to generate models and similar classes from schemas.) Then I find I've neglected to include one of...

Dynamic creation of new lookup tables based on values in main data table

I am working on an application which accepts any uploaded CSV data, stores it alongside other datasets which have been uploaded previously, and then produces output (CSV or HTML) based on the user selecting which columns/values they want returned. The database will be automatically expanded to handle new/different columns and datatypes ...

Biztalk Mapping Problem, Ideas please.

Hey folks, I'm working on a moderately complex flat file schema and I've had a curve ball thrown at me. Here's what the input looks like: BCT121,C,7.35,6.5,0.39,7216,"SMITH, TRACEY",13456321,CLASS DRESSMAKING SHOPPE,CLASS DRESSMAKING SHOPPE,VAN,BC,20090109,20090112,20090127,V,0.46, BCT121,C,14.7,13.01,0.78,7216,"SMITH, TRACEY",13456321...

Validating string lengths based on related database columns

At the one end of my web application I have a database table storing a load of pieces of text. In the middle I have an API that separates my application tiers. At the other end I have a user interface consisting of many TextBoxes (or input type=text form elements, if you prefer). I need the maxlength properties of the TextBoxes to be ...

TSQL Define Temp Table (or table variable) Without Defining Schema?

Is there a way to define a temp table without defining it's schema up front? ...

SQL Server: Creating table from stored schema?

I'd like to create a stored procedure that takes the name of table as a parameter, and then creates that table, if it doesn't exist, according to a schema stored somewhere. Is that possible--can I store a schema and use is as a template to create tables from? Or must I hard-code the CREATE TABLE and its scheme in the stored procedure it...

SQL Server (2005+) query to return the base table and base column (field) for each column (field) in a view

I want a query that will return a row for each column in a view, and a row for the view itself. There should be a column basetable in the result that gives the base table for the column in the current row, and a column basefield in the result that gives the name of the column in the underlying query (for renamed columns). It would be a ...

database schema design tools / modular database design

hello, I'm developing applications which can be build partly from modules. For example I would be able to develop some online community which contains the modules 'forum', 'blog', 'gallery', etc. Currently I have one large database ERM containing all the tables of all modules with foreign-key connections and I'm using dbwrench to build...

Referrals DB schema

I'm coding a new {monthly|yearly} paid site with the now typical "referral" system: when a new user signs up, they can specify the {username|referral code} of other user (this can be detected automatically if they came through a special URL), which will cause the referrer to earn a percentage of anything the new user pays. Before reinve...

How can I automatically determining table(s) schema from a set of queries?

Is there any tool, which will take a set of CRUD queries, and generate a 'good enough' table schema for that set: e.g. I can provide input like this: insert username, password insert username, realname select password where username=? update password where username=? update realname where username=? With this input,...

DataAdapter Select string from base table schema?

When I built my .xsd, I had to choose the columns for each table, and it made a schema for the tables, right? So how can I get that Select string to use as a base Select command for new instances of dataadapters, and then just append a Where and OrderBy clause to it as needed? That would keep me from having to keep each DataAdapter's ...

Should a single-row summary table have a primary key?

Say you've got a summary table that's meant to have only one row (storing a row of statistics about another table). In this case I'm using InnoDB so that I can update it as well as the table it's meant to contain a summary of transactionally. Should I make this table have a primary key? If so, what, just a tinyint that's always equal to ...

getting the MSSQL Schema for a table

I have the following C#.Net code that I am trying to get to return the stored procedure results along with the schema of those results. Below is how my code (simplified) currently looks... Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("MyStoredProcedure"); IDataReader drData = db.ExecuteRe...

Database Schema question

Hello all, I am having a difficult time deciding how to handle a business requirement in my database schema. I have a lot of tables in the database, but there are only three I need to deal with for this problem: Courses, PersonnelCourses, and Personnel. Courses is a list of Courses Personel is a list of Personnel PersonnelCourses is...

Need some suggestion for a database schema design

I'm designing a very simple (in terms of functionality) but difficult (in terms of scalability) system where users can message each other. Think of it as a very simple chatting service. A user can insert a message through a php page. The message is short and has a recipient name. On another php page, the user can view all the messages ...

Validating against a schema that lives inside a plugin

Background: I have a small problem with Eclipse. I'm working on a workbench plugin which has some classes that validate incoming XML data against a schema. The schema lives inside the plugin project in a "./schemas" folder. Questions: When I run the application, how can I read the schema without using a hardcoded path? When the ap...

How to update a database schema without losing your data with Hibernate?

Hi everybody! Imagine you are developing a Java EE app using Hibernate and JBoss. You have a running server that has some important data on it. You release the next version of the app once in a while (1-2 weeks) and they have a bunch of changes in the persistence layer: New entities Removed entities Attribute type changes Attribute na...