database

How do you refresh the MySQL configuration file without restarting?

Apache has such a feature, what about MySQL? Does one exist? ...

Database design for physics hardware

Hi everyone, I have to develop a database for a unique environment. I don't have experience with database design and could use everybody's wisdom. My group is designing a database for piece of physics hardware and a data acquisition system. We need a system that will store all the hardware configuration parameters, and track the change...

Are there any online database schema drawing tools?

Hi folks, i wish to draw up some database schemas. Eg, table 1 has zero to many rows in table 2, etc. It's purely for visual purposes (eg. no sql code, etc). Are there any online tools / website that offer this? (please don't say: Use Sql Server Database Diagrams, print screen, upload to image hosting service). thanks :) EDIT: Ple...

making a clean break from un-normalized wide table

I'll try to keep this example as simple as I can. I'm trying to implement a domain-driven design (a business object to represent each table) in an old VB6 app which follows no OOP patterns. The existing code is written just as you might expect from a 10 year old VB app (i.e. use of ADODB.Recordset with no intellisense for fields). The e...

SQL Index Performance

We have a table called table1 ... (c1 int indentity,c2 datetime not null,c3 varchar(50) not null, c4 varchar(50) not null,c5 int not null,c6 int ,c7 int) on column c1 is primary key(clusterd Index) on column c2 is index_2(Nonclusterd) on column c3 is index_2(Nonclusterd) on column c4 is index_2(Nonclusterd) on column c5 is index_2(...

How to read automatic increase filed befor inserting to database

Hi I have [UnicLine int identity(1,1)] filed that increase his value How I can read its value befor inserting new record to database ? thank's in advance ...

detect suspect

How To detect the suspect database in SQL server2000 With Script Or Program ? ...

How BIG do you make your Nvarchar()

When designing a database, what decisions do you consider when deciding how big your nvarchar should be. If i was to make an address table my gut reaction would be for address line 1 to be nvarchar(255) like an old access database. I have found using this has got me in bother with the old 'The string would be truncated'. I know that ...

Code-First or Database-First, how to choose?

Let us suppose we are going to start new project - application that contains some business logic, user interface on ASP.NET, WPF or both of them. We'd like to use ORM or DAL code generator and implement our business logic in .NET classes. There are several fundamental ways how we can express our ideas of business domain: Implement busi...

Get Last Value in table

I want get the last value for determine column for example in this table id name 1 Samer 2 Fahd 3 Hames 4 fuad I want get only last name "fuad" in sqlserver all thanks ...

Database to distribute on CD

What is a good way to distribute a small database on CD-ROM? The Database has to be encrypted. It must run on WinXP and Vista. The application is written in C# and is also distributed on CD. Records are only read but not written. Its ok to run an installer, but we prefer not to do it. The DB has 100000 records and performance is not t...

How do I return the last primary key of the last added item in java?

Hi all. Have a linking (or ref) table which has a dual primary key. Need to return the last primary key which was auto generated from the current connection in a selected table. This is in java. The database is in MS Access if that makes a difference. Sorry for the rushed description, but our team is working to a tight schedule. Any l...

When accessing a database over JDBC/ODBC should you create and close the connection for each request?

If you have a class that services requests from other classes for database data when should you hold onto the databse connection and when should you close it and reopen it on the next request? What if it's a service that responds to connections from external applications? (Web service, Ajax, rpc) Is it a good idea to hold a singleton c...

Checking whether a database is available?

My problem involves checking if I have a valid database connection before reading from the database. If the database is down I'd like to write to a xml file instead. I have the location of the database (if it's up) at runtime so if the database was working I can create a new sqlConnection to it. ...

What are the advantages/disadvantages of using Oracle Auto Segment Space Management?

I've been looking at switching many of our Oracle tablespaces over to use automatic segment space management. I know that it helps by managing freelists and the like, but I'm curious if anyone has seen any disadvantages to using this option? Major advantages? Our environment is somewhat a hybrid between an OLTP and Data Warehousing w...

Is it recommended practice to use uniform extent sizes in Oracle tablespaces?

I've been using Oracle for quite some time since Oracle 8i was released. I was new to the database at that time and was taught that it was best to use constant sized extent sizes when defining tablespaces. From what I have read, it seems that today using 10/11g, that Oracle can manage these extent sizes for you automatically and that i...

Are there any reasons you might not want to have a foreign_key in an association?

If you have Parent has_many :children Child Is there any reason a foreign key on Child (to Parent) and a corresponding belongs_to :parent might not be desirable? When, if ever, would you not want your Child to be able to access its parent? ...

What is the best ERD tool for forward-enginnering a SQL Server database?

My current understanding is that Microsoft does not offer a viable tool for creating a DB ERD model and then forward-engineering the DDL to create the database. I've heard that Visio Enterprise Edition 2003 had this feature, but that it has been removed in subsequent editions, and that the old edition does not operate well when installe...

Why can you not have a foreign key in a polymorphic association?

Why can you not have a foreign key in a polymorphic association, such as the one represented below as a Rails model? class Comment < ActiveRecord::Base belongs_to :commentable, :polymorphic => true end class Article < ActiveRecord::Base has_many :comments, :as => :commentable end class Photo < ActiveRecord::Base has_many :commen...

Is there a way to break into a PostgreSQL database if you forgot the password?

I have a client that has a PostgreSQL database and he cannot remember the password that we used when the database was setup. Is there a way to recover that information so I do not have to blow away his database and start from scratch? The database is running on a PC. ...