database

Oracle - Is there any effects of not having a primary key on a table ?

We use sequence numbers for primary keys on the tables. There are some tables where we dont really use the primary key for any querying purpose. But, we have Indexes on other columns. These are non-unique indexes. The queries use these non-primary key columns in the WHERE conditions. So, I dont really see any benefit of having a primary...

Do connection string DNS lookups get cached?

Suppose the following: I have a database set up on database.mywebsite.com, which resolves to IP 111.111.1.1, running from a local DNS server on our network. I have countless ASP, ASP.NET and WinForms applications that use a connection string utilising database.mywebsite.com as the server name, all running from the internal network. Th...

ODBC vs. newer methods for database management over the internet...

I am taking on a legacy project in which database management was handled over the internet using an ODBC connection. The legacy program has recently been rewritten in C#. We are currently discussing how to improve the program and I am a bit uncomfortable with using ODBC to connect to the database. I have written routines to connect to...

SQL 2005 Database not accessible

I've moved a database from sql 2000 to a new 2005 server. Everything was fine until I logged into Sql Server Management studio with one particular user. It looks like i logged in successfully but when I try to expand the database I get 'The database is not accessible'. I can log in with windows authentication and with other sql users ...

Query Performance with NULL

I would like to know about how NULL values affect query performance in SQL Server 2005. I have a table similar to this (simplified): ID | ImportantData | QuickPickOrder -------------------------- 1 | 'Some Text' | NULL 2 | 'Other Text' | 3 3 | 'abcdefg' | NULL 4 | 'whatever' | 4 5 | 'it is' | 2 6 | 'technically' |...

BCP utility corrupts data

I am running a bulk copy of two columns of a table from one server to another. The table on the source side has about 8 columns, but I only need 2. The table on the destination side has 2 columns (the two that I need, both are of type int) Both databases are SQL Server 2005. Here's my two bcp commands: c:\> bcp "select c1, c2 from s...

Drawback of large LIMIT of VAR-types

Is there any drawback (except allowing the value or array to grow too large) to setting the max integer size of a VARCHAR or VARRAY to a value significantly larger than actually necessary (or setting it to the max size allowed)? ...

Error Logging in Rails Using MySQL

I'm trying to figure out the best way to do error logging in rails using a database (in this case MySQL) as a backend. It looks like the two popular logging frameworks within rails are the built-in Logger framework and Log4r. However, as far as I can tell, neither of these support database logging to a database without writing some cus...

Single Autonumber Instead of Multiple Key

Is there a reason to use a single incrementing field for a primary key instead of multiple fields that actually represent the unique record? I'm working on an existing php application, and the tables all seem to have a single 'id' key instead of using the 2 or more fields that are actually unique to the record (like user, auction, bid)...

Is the primary key automatically indexed in MySQL?

Do you need to explicitly create this or is it implicit when define the primary key? Is the answer the same for MyISAM and InnoDB? ...

Starting my first business application?

I am starting work on my first business (application + database) type application, using c# and sql I'm completely new to this, What tips do you have for me? What should I look for? What concepts should I understand? ...

Storing images on a database

For ages I've been told not to store images on the database, or any big BLOB for that matter. While I can understand why the databases aren't/weren't efficient for that I never understood why they couldn't. If I can put a file somewhere and reference it, why couldn't the database engine do the same. I'm glad Damien Katz mentioned it on a...

How to implement one time (per user) messages in a web app?

When you want to alert a user of something once (one time notes about new features, upcoming events, special offers, etc.), what's the best way to do it? I'm mainly concerned with the data representation, but if there are more issues to think about please point them out. This is my first time approaching this particular problem. So my ...

AIR: Connect to database over network?

Is there a way to make an AIR app connect to a database over a network. I know it has a built in SQLLite but I need to connect to a database over a network. Is there anyway to do this? If not directly then maybe through the help of something else like Java. Thanks! ...

User defined data objects - what is the best data storage strategy?

I am building a system that allows front-end users to define their own business objects. Defining a business object involves creating data fields for that business object and then relating it to other business objects in the system - fairly straight forward stuff. My question is, what is the most efficient storage strategy? The requirem...

.Net 2.0 Windows Service Process Communication: Database or IPC?

I have a Windows Service running on a .Net 2.0 environment (NOT UPGRADABLE TO 3/3.5). The service uses a System.Timers.Timer on a X second Interval to poll for items on a database table. The Timer.Elapsed event handling code is wrapped around a lock statement to prevent the next Elapsed event of running if the previous processing has no...

Find more info about database

I inherited a bugzilla-like page that allows users to look at the bug list. I'd like to extend it so it can be possible to answer and close them. The problem is I don't know much about the database structure. All I have is connection details and few sample sql queries, which gives good hints about few tables. How can I find out the data...

Sql Server Row Concatenation

Hi all, I have a table (table variable in-fact) that holds several thousand (50k approx) rows of the form: group (int) isok (bit) x y 20 0 1 1 20 1 2 1 20 1 3 1 20 0 1 2 20 0 2 1 21 1 ...

User Details like in stackoverflow at the bottom of each question and answer

Hi, I was wondering how stackoverflow.com implemented user info below each post , based on data dump of stackoweflow in Posts table are : OwnerDisplayName and OwnerUserId records, but what about reputation score s and badges ? are there made joins to user table on each post ? Is there other way to get such info? Maybe i...

How to get unique short strings from integers?

Say, I have a customers with a integer PK. In my web apps I want to have a profile page for them. I do not want a url like /profile/10375/ (For example, I do not want others to know how many customers I have). I also do not want a slug base url like, /profile/acme_corp/. What is a good way to convert unique integers to unique random sho...