schema

Validating XML tag by tag

Hi All I'm having some issues validating some XML against a Schema, using .net and C#. I am using XmlReaderSettings with the ValidationEventHandler. However, this seems to stop catching errors after it has encountered the first error at a particular level within the XML file, instead of checking the next tag at the same level, so bas...

Storing Database-Agnostic Schema

We have a set of applications that work with multiple database engines including Sql Server and Access. The schemas for each are maintained separately and are not stored in text form making source control difficult. We are interested in moving to a system where the schema is stored in some text-based format (such as XML or YAML) with d...

Database Schema Design - Tips for improving ability to archive?

I am designing a table in the database which will store log entries from the application. There are a few things which is making me think about this design more than usual. However these log entries will be used at runtime by the system to make decisions so they need to be relatively fast to access. They also have the problem is that ...

Critique my auth system DB schema?

I'm designing a RESTful Web app that will provide an authentication system for several other apps. The other apps will query this app through HTTP and get back XML describing authenticated users. The authentication app needs to keep track of which users are allowed to do what on which applications. I'm working out the DB schema. Below ...

add_column for references (Rails)

I have the following Rails migration which works perfectly (irrelevant pieces removed): create_table :comments do |t| t.text :body t.references :post end Now I'd like to add an author column to my comments table (which is the userid of a user), but I have no idea how to do it (I'm tempted to just write the MySql-specific syntax us...

Is it possible to call a user-defined function without the schema name?

I'm using MS SQL 2005 and when I create a function I need to put the schema name to call it: select dbo.MyFunc All my tables are also in "dbo" schema and I don't need the schema name to reference it, so I'd like to know if I'm missing some configuration that could do the same to functions. ...

Number of columns

how do you count the number of columns in a table in oracle? ...

How can one find unknown XML namespaces in a document?

Specifically (taking a deep breath): How would you go about finding all the XML name spaces within a C#/.NET XmlDocument for which there are no applicable schemas in the instance's XmlSchemaSet (Schemas property)? My XPath magic is lacking the sophistication to do something like this, but I will keep looking in the meantime ... ...

XSD: How to depend the "use" attribute (required/optional) with the other value?

Hello, I'm trying to do some specific stuff in XSD XML Schema: I want to set an element as use="required", only if there a specific value to some attribute of other element. Example: <udi att1="all"> <name att2="dsd"/> <phone att3="dsd"/> </udi> I want the that the "phone" element will be a required one, if the "at...

Sql 2005 Backups and Schema Changes Interactions

I'm not clear about the interaction between database schema changes and differential backups on sql 2005. Lets say I do a Full backup right right now. Then I perform some schema changes. Then I do a diff backup. What happens? Do I need to create another FULL backup? Are my schema changes and any data in those new schema bits included...

How can I convert a XML file into a XSD file, using java code ?

Hi, I am looking for an API what I can convert XML files into XSD files. In my project I am using that API's JDOM and Xerces. And I can edit my attributes and namespace, but I can't transform a xml in xsd. I have no idea to how I can start. Any suggestion? ...

What good are SQL Server schemas?

I'm no beginner to using SQL databases, and in particular SQL Server. However, I've been primarily a SQL 2000 guy and i've always been confused by schemas in 2005+. Yes, I know the basic definition of a schema, but what are they really used for in a typical SQL Server deployment? I've always just used the default schema. Why would I ...

Best Database Change Control Methodologies

As a database architect, developer, and consultant, there are many questions that can be answered. One, though I was asked recently and still can't answer good, is... "What is one of, or some of, the best methods or techniques to keep database changes documented, organized, and yet able to roll out effectively either in a single-deve...

How to find the table names from a schema through Ado.net without using stored procedure etc?

I am trying to read data from excel files using datatable. The command "select * from [Sheet1$]" works fine but if the excel file has sheet with different name it gives error. So now I need know how can I find the table names available in a schema using ADO.Net. ...

DB2 Relational Tables

Is it possible to create a database such that there are 2 tables across 2 different schemas within the database who reference each other? I would like to clarify my question with an example. Consider the tables, EMPLOYEE (empID, empName, deptId) and DEPARTMENT (deptId, deptName). We can impose a foreign key constraint on the EMPLOYEE.d...

xsd schema validation

Hi all, I am having an issue with xsd schema. I have a following schema defined: <xs:element name="nodes" type="nodesRootType" /> <xs:complexType name="nodesRootType"> <xs:sequence minOccurs="1" maxOccurs="unbounded"> <xs:element name="node" type="nodeType" /> </xs:sequence> </xs:complexType> <xs:complexType name="nodeTy...

SQL equivalent of "using" for schemas?

I'm working with a SQL Server DB that's got tables spread across multiple schemas (not my idea), so queries end up looking like this: select col1, col2 from some_ridiculously_long_schema_name.table1 t1 inner join another_really_long_schema_location.table2 t2 on... ... you get the idea. This is a small inconvenience when I put...

Best Schema to Persist User Generated Functions?

My project requires users to create some basic math functions, I need to store these in a ms sql databse to use on datasets in my business logic. The functions will be similar to: when (value1 between 20 and 40) then value2 = value 2 * 37.8 What is the best schema to store something like this ? And what is the most efficient way...

Defining the database schema in the application or in the database?

I know that the title might sound a little contradictory, but what I'm asking is with regards to ORM frameworks (SQLAlchemy in this case, but I suppose this would apply to any of them) that allow you to define your schema within your application. Is it better to change the database schema directly and then update the column types in yo...

Managing Recurrent Calendaring Data

I am having to build a web app that has an event calendar section. Like in Outlook, the requirement is that users can set up recurrent events, and can move individual events around within a series of events. What methods could one use to store (in a database) the various ways you can describe the recurrence pattern of a series? How wou...