schema

Use DataContext to create schema in an existing blank database file?

With a DataContext and a blank file-based database that already exists, is it possible to write the Data Context classes (i.e. the ones I added to the designer) to create the db schema? With a data context I only see the abilities to either: create a new database file and have its structure created at the same time, or to populate...

How do I introspect on a SQL Server?

I have a server with a vendor application which is heavily database-reliant. I need to make some minor changes to the data in a few tables in the database in an automated fashion. Just INSERTs and UPDATEs, nothing fancy. Vendors being vendors, I can never be quite sure when they change the schema of a database during upgrade. To tha...

schema for storing different varchar fields over time?

This app I'm working on needs to store some meta data fields about an entity. The problem is that we can already foresee that these fields are going to change a lot in the future. Right now every entity's property is translated to one column in the entity table, but altering table columns later down the road will be costly and error-pr...

How can I save the schema of a SQL Database to a file?

I'm writing a software application in C#.Net that connects to a SQL Server database. My C# project is under SVN version control, but I'd like to include my database schema in the SVN repository as well. An answer to a previous question of mine suggested storing the scripts to generate the database in version control. Is there a way to au...

Storing n-grams in database in < n number of tables.

If I was writing a piece of software that attempted to predict what word a user was going to type next using the two previous words the user had typed, I would create two tables. Like so: == 1-gram table == Token | NextWord | Frequency ------+----------+----------- "I" | "like" | 15 "I" | "hate" | 20 == 2-gram table == Token ...

How can I change column length using HQL query?

I tried session.createSQLQuery("ALTER TABLE People MODIFY address VARCHAR(1000);").executeUpdate(); but this throws org.hibernate.exception.SQLGrammarException: could not execute native bulk manipulation query After a lot of googling, the recommendation is to use HQL instead of SQL query to do bulk updates. Not sure how to use HQL to a...

Database with "Open Schema" - Good or Bad Idea?

The co-founder of Reddit gave a presentation on issues they had while scaling to millions of users. A summary is available here. What surprised me is point 3: Instead, they keep a Thing Table and a Data Table. Everything in Reddit is a Thing: users, links, comments, subreddits, awards, etc. Things keep common attribute like up/down...

Multiple schema validation in Java

Hi, I am trying to do multiple schema validation in Java. I don't understand where I am doing wrong. Any help will be appreciated. abc.xsd <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xn="project-xml-r4j_another.xsd"> <xsd:import namespace="project-xml-r4j_another.xsd"/> <xs...

How can i tell jaxb / Maven to genereate multiple schema packages?

Example: </plugin> <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>0.7.1</version> <executions> <execution> <goals> <goal>generate</goal> </goals> </ex...

avoid the use of 'mixed=true' in xml schema

I am using xjc to convert a schema to java classes. When I am using mixed=true in the schema I am losing the access method for child nodes instead there is a single general content access method. Is there a way to rewrite the schema without using mixed=true. There is no way that I can change the xml so I have to customize the schema. S...

How to create an xml schema with key/keyrefs for nested elements of the same type

I work with some XML files on a regular basis and want to have better validation then a DTD can provide. So I started reading about schemas to see if would help me out. So far I've been able to create something that works almost like I need except for one piece. I want to be able to restrict the attribute of an element to the values of a...

Is there an application that can help someone create an XML document based on the Relax NG schema?

I've spent a bit of time creating a Relax NG schema for use within our team to validate XML documents we use for exchanging information. The schema is not complicated, but it is reasonably large. I am wondering if there exists a tool that can read in such a Relax NG schema and assist a user in creating a corresponding instance document,...

Merge two xml schemas using XSLT

I'm transforming an XML Schema using XSLT 2.0. The first schema (s1.xsd) imports a second schema (s2.xsd) as follows: Content of s1.xsd <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema.xsd" xmlns:ns1="URI1" targetNamespace="URI2" elementFormDefault="qualified" attributeFormDefau...

Foreign key on table A --> B, AND foreign key on table B --> A. How is this done?

Hi, I have two tables - 'business' and 'business_contacts'. The business_contact table has a many-to-one relationship with the business table. Furthermore, each business has a 'primary contact' field - which I'd assume is a one-to-many relationship with the business_contacts table. The problem, of course, is that this creates a catch-...

Core Data No Longer Updating Sqlite Schema

I am using core data for my app and I never had any problems adding or removing columns until recently. But now even if I make changes to my xcdatamodel and generate new and updated entity h/m files, sqlite doesn't seem to be picking up the changes. I actually went over to the documents folder and inspected the create statement for th...

which is better, creating a materialized view or a new table?

I have some demanding mysql queries that have to select same frequently updated datasets from 5-7 mysql tables. 'Select' operation would be a bit more than CUD. I am thinking of creating a table or materialized view to gather all demanding columns from other tables, so as to reduce overall query times to different tables and thus incre...

A MySQL schema parser in Java?

Hi all, Does anyone know whether there is a java library for parsing a MySQL schema? In code I want to be able to determine the tables and fields specified in a schema. Or will I need to write my own? Thanks Richard. Edit: Just want to avoid re-inventing the wheel unnecessarily :) ...

How do I get schemas from Perl's DBI?

I have using Perl DBI. In that $dbase->tables() will return all the tables in the corresponding database. Like this I want to know the schema's available in the database. Is there any function available for that? ...

Database scheme for strong SNMP data

Hi, I am trying to build a MYSQL DB for storing SNMP MIB information (a small subset of OIDs only).. Is there a DB schema that I may refer to? Thanks, Neel ...

How do I include a web.config custom section schema without having to update each dev machine?

Hi, I've added a new custom section to the web.config of an application. I have also created a corresponding schema file for the new section definition. How do I include the schema reference in the web.config so that any developer editing the section has intellisense enabled when dealing with my new custom config section? I've seen ...