database

Can I set VARCHAR size larger than 8k but less than MAX?

Starting in SQL 2005, VARCHAR(MAX) is no longer limited to 8000 bytes, it instead can go up to 2GB using "overflow" pages. But what if I want to limit this column to say, 10k bytes? It seems I get an error if I try to put anything in the size parameter above 8000. Which is odd because MAX is the same as asking for a 2GB limit. Seems ...

How do you get the last access (and/or write) time of a MySQL database?

How do you find out the last time a MySQL database was read or written to? Can you even do that check per table? ...

Insert data into database [Delphi]

I'm trying using a TAdoTable component, On form Create I call .Append() and in a button i call .Post() but it loads the entire table! I don't need it to load anything, just need to insert a row into this table. I was wondering if there is "good way" of inserting data into database with Ado, i already tried using the a "manual" appro...

How do I import Spanish into a SQL DB?

So I have some Spanish content saved in Excel, that I am exporting into a .csv format so I can import it from the Firefox sql manager add-on into a .sql db. The problem is that when I import it, whenever there is an accent mark, (or whatever the technical name for those things are) Firefox doesn't recognize it, and accordingly produces a...

Any python/django function to check whether a string only contains characters included in my database collation?

hi, As expected, I get an error when entering some characters not included in my database collation: (1267, "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='") Is there any function I could use to make sure a string only contains characters existing in my database collation? th...

Problems calling Android's getSharedPreferences(); from SQLiteOpenHelper class

Hi, First I want to describe my situation briefly. I have two classes, one MainClass and one DataBaseHelper class, which extends SQLiteOpenHelper. From my MainClass I call a method in the DataBaseHelper class to open a data base. Before opening the data base I want to check the users data base version (this is important as soon as I ...

How do I make my database connection secure?

I'm currently working on a website for my church's college group, and am started to get a little worried about the security of what I'm writing. For instance, I use this function: function dbConnect() { global $dbcon; $dbInfo['server'] = "localhost"; $dbInfo['database'] = "users"; $dbInfo['username'] = "root"; $dbInfo['pas...

Database migration from new YAML in Doctrine

I have to add a new column and a new table to my database but i dont have access to shell of my server. I changed my YAML file. How can i tell doctrine to "migrate models and database to changed yaml"? ...

Why are comment ids in Wordpress continuous (unique)?

I notice that in WP blogs the comments order by continuous id (id=203, id=204 and so..). while I understand the class names "parent" "child" - to sort the reply to thread, I didn't figure out why the id's are continuous - maybe to choose hide/show specific comments? ...

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters.

It seems that this part of my code is where the exception occurs: c = dbConnection.getConnection(); q = "SELECT * FROM book WHERE nextInc<=? AND inlib=?"; s = c.prepareStatement(q); s.setBigDecimal(1,BigDecimal.valueOf(curDate.getTime())); s.setBoolean(2,false); rs = s.executeQuery(); <-- Error. I'm using "sun.jdbc.odbc.JdbcOdbcDr...

Guice, JDBC and managing database connections

I'm looking to create a sample project while learning Guice which uses JDBC to read/write to a SQL database. However, after years of using Spring and letting it abstract away connection handling and transactions I'm struggling to work it our conceptually. I'd like to have a service which starts and stops a transaction and calls numerou...

Export SQL Server Database to Access using entity framework

Is it possible to export a sql server database (2008) to a new access database using the Entity framework (or anything else for that matter in code)? I have developed a desktop facing application that connects to a sql sever on a server and my client wants to be able to take snapshots of the database in access to send to people who do...

Get MySQL data without stressing server

I'm wondering what the best way is to prevent my server from being stressed when I want to get a lot of data using PHP. Convert all my data to an XML sheet? Use caching? The data comes from many different databases and different tables. Any ideas? Thanks in advance ...

problem with checkbox item insertion in database table

Hi all, While i am inserting the checkbox selected list item to the database table i am getting this error "Error converting data type nvarchar to bit" In the table i have a field called Disease with bit datatype. My motto to store the different type of disease in one field. Here is selecting checkbox item code: Pls somebody point me out...

Two quick question on transaction behaviour

I have code that looks like this: function foobar(array& $objects, $con = null) { if (is_null($con)) $con = DbSingleton::getConnectio(); $con->beginTransaction(); // <- question 1 try { foreach($objects as $object) { // allocate memory for new object $new_obj = new MyShiningNewObject(); ...

Simplest database implementation

I am looking for a really simple database implementation; basically one with no complex parsing SQL engine. What I am looking for is something demonstrating B+ trees and ACID storage (Suitable for educational purposes). What I have found up-till now form my current searches was hamster-db. I am looking for something even simpler with a s...

How to run SP in sql server after every 1 hour ?

I have a table on which i want to perform some operations after every hour. For this I created a Stored Procedure but dont know how to call it after every hour. I know their are some kind of scheduled jobs but how to use them. Is it their some kind of service also that keeps on running continously every second where i can place my piec...

Order database query results along a curve

i have a table of songs and their beats-per-minute values, and i would like to build playlists that follow a curve like this: ^ . . . | . . b | . . p | . . m | . . x--------------------> time i realize this is probably not possible in a single SQL statement, but i'm in...

In what way does denormalization improve database performance?

I heard a lot about denormalization which was made to improve performance of certain application. But I've never tried to do anything related. So, I'm just curious, which places in normalized DB makes performance worse or in other words, what are denormalization principles? How can I use this technique if I need to improve performance?...

What is a manhattan database?

A friend of mine was interviewing for a data warehouse and Business Object role But he was asked about the Manhattan database? I have Googled "Manhattan database" and even searched for it on Bing and Yahoo but have found no relevant information. Any help would be greatly appreciated! ...