database

Checking for the presence of text in a text column efficiently

I have a table with about 2,000,000 rows. I need to query one of the columns to retrieve the rows where a string exsists as part of the value. When I run the query I will know the position of the string, but not before hand. So a view which takes a substring is not an option. As far as I can see I have three options using like ‘% %’...

Implementing filters for a SQL table display on a view in ASP.NET MVC (C#) and LINQ-to-SQL?

A follow-up from this question, I've changed my controller and routing around so that now the sort value is assigned by ?sort= however I also want to implement the ability for users to filter the table based on a select set of values: Technician : Tech1, Tech2, Tech3, etc. Category : Category1, Category2, Category3, etc. Priority : Prio...

How Many Tables Should be Placed on the Same Partition Scheme?

My company just provided me with SQL Server 2005 Enterprise Edition and I wanted to partition some tables with large(r) amounts of data. I have about about 5 or 6 tables which would be a good fit to partition by datetime. There will be some queries that need 2 of these tables in the course of the same query. I was wondering if I should...

Best way to create a default Database setup via an .aspx page?

We are going to be selling a service that will be hosted by us, and each client we host will have their own database, but there will be one centralized website. I currently have a blank database with the few things that a new client will need. What is the best way to copy this database so I can setup another client? I want to be able ...

Is there any overhead with LINQ or the Entity Framework when getting large columns as part of an entity?

Let's say you have a table containing articles and you want want to display a list of them, excluding the actual article text. When you get a list of the article objects using LINQ or the Entity Framework, is there a LOT of overhead associated with getting that text column too? I assume that when you start enumerating the list, the art...

What are the security implications of not closing connection to the database after you are done with it?

I was just wondering what security issues can arise from not closing the database connection after using it. Doesn't PHP automatically close it once a new page loads? Levi ...

How to store lightweight formatting (Textile, Markdown) in database?

I'm going to be implementing a lightweight formatting language (probably Textile, maybe Markdown) in a project I'm working on, and I'm wonder how best to store it in the database. If the user is able to edit the content they're posting, it makes sense to me that the original, non-converted markup be stored so that the user doesn't have ...

How to limit a LINQ left outer join to one row

I have a left outer join (below) returning results as expected. I need to limit the results from the 'right' table to the 'first' hit. Can I do that somehow? Currently, I get a result for every record in both tables, I only want to see one result from the table on the left (items) no matter how many results I have in the right table (pho...

What is the best approach to use when upgrading a Database

We have a system that has a Mysql database with about 2Gigs of data. The PC application that talks to the database has just been updated. There are a number of tables whose structure have changed and we need to run a conversion script. The system is only used in office hours Question: What is the best approach to doing this upgrade...

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 ...

SQL Server Automated Backups

What are the recommendations of software products for creating automated backups of SQL Server 2008 databases? The backup should happen without taking the database offline/detatching. ...

What happens if I don't include a db driver when using JDBC?

I'm new to java development, and was happy to see how much easier the database implementation was when it comes to supporting several platforms, compared to the php environment I'm used to. There is, however, one thing I'm confused about - I read everywhere I have to do a runtime-include of the database driver I want to use, ie: Class....

Best beginner resources for understanding the EAV database model?

I'm doing some custom work with Magento, which has a database design based upon the EAV model, and I need some good resources/tutorials that explain the EAV database model. Please don't provide Wikipedia as a resource... I'm looking for something that teaches EAV in a friendly way for beginners. ...

Pulling in Dynamic DBF Columns

Hello, I have been asked to pull in columns for use in a web app.I am using asp.net and C#. I was using a dataReader to populate the class variables. The problem is that the dbf file can change. Sometimes rows are added or deleted so my class would have to change every time the data source file changes to represent the columns Is there ...

where to store database string connection in java web app???

I'm about to begin my first project with java Let me tell how I used to handle these things... So far now, I've been workin on asp with a com+ componente made with VB6. The component is registered via the com+ administration console with a domain user, something lile my_company_domain\my_app_account The components reads the configura...

Java security in non-web app

Does anyone know of a good, open source security framework for java? I've played with jSecurity a bit, and it seems really cool, but the documentation is so sparce I can't seem to make any progress. Spring security seems web-app oriented -- but I may be wrong. I am not opposed to writing this myself, but it seems like this should ha...

LIMITing an SQL JOIN

Hi there, I am trying to limit the following SQL statement. SELECT expense.*, transaction.* FROM expense INNER JOIN transaction ON expense_id = transaction_expense_id What I want to do, is limit the number of 'parent' rows. IE. if I do a LIMIT 1, I would receive only one expense item, but still get all transactions associated with it....

Looking for a DB Schema Drawing tool on Mac OS X

I am looking for an easy-to-use db schema drawing tool for Mac. No reverse-engineering nor db schema generation needed, just a simple drawing tool with pre-designed db-related graphical components (boxes, relations-arrows, PK/FK symbols ...) Do you know any (non-commercial) good tool ? ...

Verfying a database is as you expect it it be

I've been writing a java app on my machine and it works perfectly using the DB I set up, but when I install it on site it blows up because the DB is slightly different. So I'm in the process of writing some code to verify that: A: I've got the DB details correct B: The database has all the Tables I expect and they have the right colum...

SQL Server - Transactional Replication (partial data only)

I have 6 months of data, how do I replicate only the most current 3 months of data to the subscribers? ...