database

Mechanisms for tracking DB schema changes

What are the best methods for tracking and/or automating DB schema changes? Our team uses Subversion for version control and we've been able to automate some of our tasks this way (pushing builds up to a staging server, deploying tested code to a production server) but we're still doing database updates manually. I would like to find o...

Any experiences with Protocol Buffers?

I was just looking through some information about Google's protocol buffers data interchange format. Has anyone played around with the code or even created a project around it? I'm currently using XML in a Python project for structured content created by hand in a text editor, and I was wondering what the general opinion was on Protoco...

Which tools do people use to create Data Dictionaries?

On the project that I am working on I have a couple of databases. Each table and each column in the database has a description set (as an extended property in SQL 2005). As a part of the documentation going to the client we need to produce a data dictionary showing all of the tables and columns along with a collection of meta data (data-...

Are Multiple DataContext classes ever appropriate?

In order to fully use LinqToSql in an ASP.net 3.5 application, it is necessary to create DataContext classes (which is usually done using the designer in VS 2008). From the UI perspective, the DataContext is a design of the sections of your database that you would like to expose to through LinqToSql and is integral in setting up the ORM ...

What language do you use for Postgresql triggers and stored procedures?

Postgresql is interesting in that it supports several languages for writing stored procedures. Which one do you use, and why?...

What is the best way to avoid SQL injection attacks?

I've provided a solution for Python... please flesh this out with examples for other languages. ...

Have you ever encountered a query that SQL Server could not execute because it referenced too many tables?

Have you ever seen any of there error messages? -- SQL Server 2000 Could not allocate ancillary table for view or function resolution. The maximum number of tables in a query (256) was exceeded. -- SQL Server 2005 Too many table names in the query. The maximum allowable is 256. If yes, what have you done? Given up...

Auto Generate Database Diagram MySQL

I'm tired of opening Dia and creating a database diagram at the beginning of every project. Is there a tool out there that will let me select specific tables and then create a database diagram for me based on a MySQL database? Preferably it would allow me to edit the diagram afterward since none of the foreign keys are set... Here is wh...

Is it better to create Model classes, or just stick with generic database utility class?

We have a simple utility class in-house for our database calls (a light wrapper around ADO.Net), but I am thinking of creating classes for each database/object. Would it be smart to do so, or would it only benefit if we were using the full MVC framework for ASP.Net? So we have this: SQLWrapper.GetRecordset(connstr-alias, sql-statement...

How to Test Web Code?

Does anyone have some good hints for writing test code for database-backend development where there is a heavy dependency on state? Specifically, I want to write tests for code that retrieve records from the database, but the answers will depend on the data in the database (which may change over time). Do people usually make a separate...

What are your favorite .NET Object Relational Mappers (ORM)?

What sort of Object Relational Mapping (ORM) systems do you use on various projects? What scale is the project? What features do you use and look for in an ORM? ...

Storing Images in DB - Yea or Nay?

So I'm using an app that stores images heavily in the DB. What's your outlook on this? I'm more of a type to store the location in the filesystem, than store it directly in the DB. What do you think are the pros/cons? ...

Suggestions for implementing audit tables in SQL Server?

One simple method I've used in the past is basically just creating a second table whose structure mirrors the one I want to audit, and then create an update/delete trigger on the main table. Before a record is updated/deleted, the current state is saved to the audit table via the trigger. While effective, the data in the audit table is...

What program can I use to generate diagrams of SQL view/table structure?

I've been tasked with redesigning part of a ms-sql database structure which currently involves a lot of views, some of which contain joins to other views. Anyway, I wonder if anyone here could recommend a utility to automatically generate diagrams to help me visualise the whole structure. What's the best program you've used for such p...

LinqDataSource - Can you limit the amount of records returned?

I'd like to use a LinqDataSource control on a page and limit the amount of records returned. I know if I use code behind I could do something like this:IEnumerable<int> values = Enumerable.Range(0, 10);IEnumerable<int> take3 = values.Take(3); Does anyone know if something like this is possible with a LinqDataSource control? [Update] I'm ...

Is there any trick that allows to use Management Studio's (ver. 2008) IntelliSense feature with earlier versions of SQL Server?

New version of Management Studio (i.e. the one that ships with SQL Server 2008) finally has a Transact-SQL IntelliSense feature. However, out-of-the-box it only works with SQL Server 2008 instances. Is there some workaround for this? ...

Simple MOLAP solution

To analyze lots of text logs I did some hackery that looks like this Locally import logs into Access Reprocess Cube link to previous mdb in Analisis Service 2000 (yes it is 2k) Use Excel to visualize Cube (it is not big - up to milions raw entries) My hackery is a succes and more people are demanding an access to my Tool. As you see I ...

SQL Case Statement Syntax?

What is the full correct syntax for the SQL Case statement? ...

MOSS SSP problem - Failed database logons from deleted SSP

We've been having some issues with a SharePoint instance in a test environment. Thankfully this is not production ;) The problems started when the disk with the SQL Server databases and search index ran out of space. Following this, the search service would not run and search settings in the SSP were not accessible. Reclaiming the disk s...

What point should someone decide to switch Database Systems

When developing whether its Web or Desktop at which point should a developer switch from SQLite, Mysql, MSSql, etc, etc...