database

C# DataSets batch updates

I have a number of rows to update/insert to a SQL Server database using TableAdapters. Is there a way to batch them together, so that while it's still a list of UPDATE statements, at least it's only one remote call to the database? If I was writing SQL manually, it would be a single SqlCommand object with a CommandText that looks somet...

Tool Compare the tables in two different databeses

I am using Toad. Frequently i need to compare tables in two different test environments. the tables present in them are same but the data differs. i just need to know what are the differences in the same tables which are in two different data bases.Are there any tools which can be installed on windows and use it to compare. Much apprec...

Output paramaters not updated after ExecuteReader()

When I run cmd.ExecuteScalar() or cmd.ExecuteNonQuery() the Output and InputOutput parameters on the command object get updated from the changes in the stored procedure. However the same does not happen for cmd.ExecuteReader(). This is happening on both Sql Server and MySql Connections. Is this behavior by design? ...

Single User after renaming an MS-SQL database

I am using help of SqlServer.Management.Smo to rename an attached MS-SQL database. Dim db As New Database = ActiveSQLServer.Databases(OLD_NAME) db.ExecuteNonQuery("ALTER DATABASE " & OLD_NAME & " SET SINGLE_USER WITH ROLLBACK IMMEDIATE") db.ExecuteNonQuery("ALTER DATABASE " & OLD_NAME & " MODIFY NAME = " & NEW_NAME) The problem is tha...

Explicit Opening and Closing cursors

Hi Guys. I've been reading up on database cursors, and every bit of sample code I've seen explicitly opens and closes the cursor. I've only used them a few times and I've never had to do this. Can anyone tell me why it is necessary to do this? I know if you don't close a cursor you can create memory leakes but i've never had to open one...

How to maintain referential integrity with common great-parent table?

Lets say I have a table with "Groups of Questions" GroupID | value --------+------ 42 | How often do you 9071 | Other question ... And, for each group of questions I have "questions" and "possible answers" Group | QuestionID | value ------+------------+------ 42 | 5 | ... brush your teeth? 42 | 89 | .....

C#/ASP.NET: Create Database Report?

How would I go about creating a report that retrieves data from a database? ...

What indexing implemetations can handle arbitrary column combinations?

I am developing a little data warehouse system with a web interface where people can do filtered searches. There are current about 50 columns that people may wish to filter on, and about 2.5 million rows. A table scan is painfully slow. The trouble is that the range of queries I'm getting have no common prefixes. Right now I'm using sql...

secure database distribution to external clients

We want to distribute / synchronize data from our Datawarehouse (MS SQL Server) to external customers (also MS SQL Server). The connection has to be secure, because we are dealing with trusted data. Transmission of data from our system to external client system must be via the http/https In addition it is possible that the clients still...

Looking for combinations of server and embedded database engines

I'm redesigning an application that will be run as both a single user and multiuser application. It is a .NET 2.0 application. I'm looking for server and embedded databases that work well together. I want to deploy the embedded database in the single user setup and of course, the server in the multiuser setup. Past releases have been ba...

Basic NMock database examples for CRUD application

I'm looking for some basic examples of using NMock2 to mock database calls for a CRUD application. Thanks, Chris ...

What is MYSQL Partitioning?

I have read the documentation (http://dev.mysql.com/doc/refman/5.1/en/partitioning.html), but I would like, in your own words, what it is and why it is used. Is it mainly used for multiple servers so it doesn't drag down one server? So, part of the data will be on server1, and part of the data will be on server2. And server 3 will "p...

When setting MySQL schema, why use certain types?

When I'm setting up a MySQL table, it asks me to define the name of the column, type of input, and length. My assumption, without having read anything about it, is that it's for minimization. Specify the smallest possible int/smallint/tinyint for your needs, and it will reduce overhead of some sort. If it's all positives, make it unsigne...

When is the size of the database call more expensive than the frequency of calls?

Can someone give me a relative idea of when it makes more sense to hit the database many times for small query results vs caching a large number of rows and querying that? For example, if I have a query returning 2,000 results. And then I have additional queries on those results that take maybe 10-20 items, would it be better to cache ...

How do I list all the columns in a table?

For the various popular database systems, how do you list all the columns in a table? ...

Android RadioButton return a constant?

I am trying to perform a rating system, where with the choices to select from returns a constant number so I can insert a value into a database. My intentions are to have 3 choices, 'Great', 'Mediocre' and 'Bad'. I would like Great to be a constant for '3', Mediocre to have a constant '2' and Bad to have a constant for '1'. I would like ...

How to design table that can be re-sequenced?

I need to make a design decision about database. The requirment is that one database table has an *AUTO_INCREMENT PRIMARY KEY* field called id. By default, each row is shown to user (in web) sorted ascendenting by id. For example, if there are 4 records in the table. The UI will show rows in sequence of 0, 1, 2, 3. Now, there is require...

PGCluster Replication problem

When starting the PGCluster replication server I get the follwing problem: postgres@mybox:/usr/local/pgsql/bin$ ./pgreplicate -D ../etc -l -n -v *** buffer overflow detected ***: ./pgreplicate terminated ======= Backtrace: ========= /lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0xb7e69da8] /lib/tls/i686/cmov/libc.so.6[0xb7e67eb0] ./...

PHP MySQL inserting data to multiple tables

Hi, I'm trying to make an experimental web application which minimises redundant data. I have three example tables set up like so: Table one ID | created_at (unix timestamp) | updated_at (unix timestamp) Table two ID | Foreign Key to table one | Title Table three (pages) ID | Foreign Keys to both table one and two | Content | Metadata...

Is it good practice to set all database columns as NOT NULL ?

Normally is it good practice to set all database columns as NOT NULL or not ? Justify your answer. ...