database

Using SQL Server Database View for populating DataGridView and modifying data in DB

Using SQL Server Database View for populating DataGridView and modifying data in DB I want to know that how this will be done and if this is not a good solution, then please elaborate if any other good solution is possible. 1) Initially I want to use a Database View for populating different DataGridViews. 2) Multiple joins from mult...

How to optimize mysql database automatically in PHP?

i have a database and need to automatically optimize this 24 hourly What should I do? ...

Sybase: programmatically turn off foreign key checks

Hi, I need to do bulk inserts/updates/deletes on a table-by-table basis via JDBC. Database is Sybase. Because of FK checks, I can't do this, because I temporarily violate integrity. In MySQL I can easily turn off and on constraint checks, by issuing a simple command. Is there some way to do the same in Sybase? Thanks. ...

Can we use MongoDB with ORMs we used to use with relational databases, such as linq2sql, entity framework, subsonic,...?

I want to know if its possible based on your experience to use our previous experiences using .net ORMs with nosql db such as MongoDB. And also if you know samples doing this please refer in your answer. ...

how to implement full text search in database

I understand that full text indexing and search for a database can be enabled by a lot of pre-packaged products. However, just out of academical curiosity, I wonder how are those full text indexes actually implemented. I have tried to google for results with little answer. Please any feedback would be much appreciated. ...

Refresh databases data

How can i refresh the data from my database(ms access) in c# using windows form aplication? part of the code where i insert the data : insertCommand.Parameters.Add("@ID_uporabnika", OleDbType.Integer).Value = Convert.ToInt32(textBox6.Text); insertCommand.Parameters.Add("@datum", OleDbType.DBDate).Value = DateTime.Now.ToShortDateString()...

Logic: Best way to sample & count bytes of a 100MB+ file

Let's say I have this 170mb file (roughly 180 million bytes). What I need to do is to create a table that lists: all 4096 byte combinations found [column 'bytes'], and the number of times each byte combination appeared in it [column 'occurrences'] Assume two things: I can save data very fast, but I can update my saved data very slo...

Efficient database access when dealing with multiple abstracted repositories

I want to know how most people are dealing with the repository pattern when it involves hitting the same database multiple times (sometimes transactionally) and trying to do so efficiently while maintaining database agnosticism and using multiple repositories together. Let's say we have repositories for three different entities; Widget,...

Is it possible to write a database view that encompasses one-to-many relationships?

So I'm not necessarily saying this is even a good idea if it were possible, since the schema of the view would be extremely volatile, but is there any way to represent a has-many relationship in a single view? For example, let's say I have a customer that can have any number of addresses in the database. Is there any way to list out ea...

How to use a .UDL database connection with Java

Does anyone know how to implement a basic .UDL file (MS Data Link File) database connection using Java? Is it possible? Is there a special 3rd party driver I would need? ...

Mysql advanced SELECT, or multiple SELECTS? Movies keywords

I have a mysql database with movies as follows: MOVIES(id,title) KEYWORDS_TABLE(id,key_id) [id is referenced to movies.id, key_id is refernced to keywords.id] KEYWORDS(id,keyword) //this doesn't matter on my example.. Basically i have movies with their titles and plot keywords for each one, i want to select all movies...

Does SQLite multi column primary key need an additional index?

If I create a table like so: CREATE TABLE something (column1, column2, PRIMARY KEY (column1, column2)); Neither column1 nor column2 are unique by themselves. However, I will do most of my queries on column1. Does the multi column primary key create an index for both columns separately? I would think that if you specify a multi colum...

Large strings: Text files or SQL DB?

I am coding a forum system using PHP. I am currently storing a threads ID, title, author, views and other attributes in an SQL database and then storing the thread body (the HTML and BBcode) in text files inside a folder named after the thread ID. In practise it's really simple to grab the database values then just grab the thread bod...

Does the order of the columns in a SELECT statement make a difference?

This question was inspired by a previous question posted on SO, "Does the order of the WHERE clause make a differnece?". Would it improve a SELECT statement's performance if the the columns used in the WHERE section are placed at the begining of the SELECT statement? example: SELECT customer.id, transaction.id, ...

Why (and when to) use stored procedures?

Possible Duplicate: What are the pros and cons to keeping SQL in Stored Procs versus Code What would be appropriate scenario when stored procedures should be used? I stumbled upon implementation where almost whole data manipulation was handled by store procedures, even simplest form of INSERT/DELETE statements were wrapped an...

secure data transport between web server and database server

I'm planning on provisioning a web server and database server in a server farm environment. They will be in the same network but not in the same domain, both windows server 2008 and the database server is sql server 2008. My question being, what is the best way to secure data in transport between the servers? I've looked into IPSEC an...

Performance implications of using crontab to automate numerous DB tasks?

I think I'm going to use crontab to run a bunch of scripts that will: close all expired posts accept uncontested disputes add interest charges email out invoices send "about to expire" notifications I want the expired stuff to be removed pretty shortly after the event occurs, so I'm thinking about writing one script that will run and...

Optimising Database Calls

I have a database that is filled with information for films, which is (in turn) read in to the database from an XML file on a webserver. What happens is the following: Gather/Parse XML and store film info as objects Begin Statement For every film object we found: Check to see if record for film exists in database If no film rec...

Does a Postgresql dump create sequences that start with - or after - the last key?

I recently created a SQL dump of a database behind a Django project, and after cleaning the SQL up a little bit was able to restore the DB and all of the data. The problem was the sequences were all mucked up. I tried adding a new user and generated the Python error IntegrityError: duplicate key violates unique constraint. Naturally I ...

Finding databases for use in applications

Does anyone have some recommendations on how I can find databases for random things that I might want to use in my application. For example, a database of zip code locations, area code cities, car engines, IP address locations, food calorie counts, book list, or whatever. I'm just asking generally when you decide you need a bunch of d...