database

Best database field type for a URL

I need to store a url in a MySQL table. What's the best practice for defining a field that will hold a URL with an undetermined length? ...

What are the uses for Cross Join?

A cross join performs a cartesian product on the tuples of the two sets. SELECT * FROM Table1 CROSS JOIN Table2 Which circumstances render such an SQL operation particularly useful? ...

How do you handle BLOB and numerical data efficiently in database communication?

SQL databases seem to be the cornerstone of most software. However, it seems optimized for textual data. In fact when doing any queries involving numerical data, integers specifically, it seems inefficient that the numbers are getting converted to text and then back to native formats both ways between the application and the database. Th...

Database Localization - Lookup lists - smarter way

I'm looking to add some lookup lists in the database, but I want them to be easy localizable (SQL 2005, ADO.NET) This would include: Easy Management of multiple languages at the same time Easy Retrieval of values from the database Fallback language (in case the selected language is missing) I was thinking about having a table that w...

How can I encrypt password data in a database using PHP?

I am connecting to a MySQL database with PHP and the CodeIgniter Framework. I want to store my passwords encrypted in the database and would like to know the best way to do this. ...

Parsing A Data Feed

I'm not the best at PHP and would be extremely grateful if somebody could help. Basically I need to parse each line of a datafeed and just get each bit of information between each "|" - then I can add it to a database. I think I can handle getting the information from between the "|"'s by using explode but I need a bit of help with parsi...

Simplest way to print out the contents of a text field in SQL Server

I need to output the contents of a text field using MS Query Analyzer. I have tried this: select top 1 text from myTable (where text is a text field) and DECLARE @data VarChar(8000) select top 1 @data = text from myTable PRINT @data The first one prints only the first 2000 or so characters and the second only prints the first 800...

Are DbProviderFactory, DbConnection, DbCommand, and DbDataAdapter

Are the .net classes relating to DbProviderFactory thread safe? ...

Access control for multiple users in a web application

I'am working on a PHP + MySQL Social Networking application, now i need to setup different access control (read,create,edit,delete) for global (all items) and/or self items (item which created by themselves) for each module to group or specific user. Does anyone has suggestions in doing this (table structures, etc)? ...

database design and program design

How is database design different from program design? ...

How many fields is 'too many' in a table?

I have a coworker who is planning a database for a new app that will have several tables with over 30 fields each. Is this excessive? Maybe I'm just not enterprisey enough to understand. Edit: Also, a lot of the fields are option-type sort of things (like on a request form, would you like your widget to be yellow or green, he has a fie...

Most efficient data type for UUID in database besides a native UUID.

What would be the most efficient data type to store a UUID/GUID in databases that do not have a native UUID/GUID data type? 2 BIGINTs? And what would be the most efficient code (C# preferred) to convert to and from a GUID to that type? Thanks. ...

Using multiple BindingSources on one DataTable

I have a DataTable that has a boolean column called [Invalid]. I need to divide this data up by this Invalid column - valid rows can be edited, invalid rows cannot. My original plan was to use two BindingSources and set the Filter property ([Invalid] = 'false', for instance), which plays right into my hands because I have two DataGridVie...

Pros and cons of using md5 hash of URI as the primary key in a database

I'm building a database that will store information on a range of objects (such as scientific papers, specimens, DNA sequences, etc.) that all have a presence online and can be identified by a URL, or an identifier such as a DOI. Using these GUIDs as the primary key for the object seems a reasonable idea, and I've followed delicious and ...

What is best practice for this problem (different properties for different categories)?

Hi. I have some products that belongs to the some category. Each category can have different properties. For example, category cars has properties color, power, ... category pets have properties weight, age, ... Number of categories is about 10-15. Number of properties in each category is 3-15. Number of products is very big. M...

Normalizing a common ID type shared across tables

This is a simplified version of the problem. We have customers who send us lots of data and then query it. We are required by them to have several "public" ids they can query our data by. (Most want to query our system via the id they send along with the data, but not always). For simplicity, we'll call them "pid", "crid" and "music...

Database Table or XML

Hi All, I'm in the process of designing a small website and was curious when an XML file can/should be substituted for a database table. There are some cases where I think using a database table may be overkill and was just wondering if anyone else has come across making this decision. Thanks! ...

Alternatives to Access

Are there any alternatives to MS Access? Requirements: Portable Database file Integrated form development for data entry No compiling necessary. Can be modified on the fly. Two more requirements: Available for Linux or Windows Does not have to be free EDIT: Emphasised Integrated form development for data entry as the top voted ...

Entity Framework model update on a remote machine

I'm building a web application that uses the Entity Framework. The files are located on a remote machine, the same is for the database and the web server. In visual studio (2k8sp1), the path to the project is: \\Server\Web\XXXX Now, I've generated the EF entities from the database, and later I've updated the database and added there a ...

MS Access Front-End Alternative?

Background I work for a large organization which has thousands of MS Access applications floating around. I didn't write any of these - in fact, most of the original authors have long since left the company - but from time to time another Access app lands on my desk for support. I would soooo love to replace access with a different so...