database

Need to create new database without using management studio

How to create new database with SQL Server Express 2008 without using Management Studio? Do i need to download sp1? ...

Basic database design about intermediate optional models

I'm working on a project in which I'm having slight difficulties coming up with the design for a seemingly very simple scenario: user belongs to city which belongs to country, however, the city reference may be null while user must belong to a country nevertheless. In other words (in basic RoR model syntax), # class User < ActiveRecord...

Storing Schedule in Database

How do i store routine or schedule in Database in efficient way.Such as i have 20 rooms and in this rooms 8-10,10-12,... this way classes are held.How do i store this sort of schedule in database in efficient way? ...

Can't insert to database in wordpress

I tried to insert values to database table in wordpress, but it is showing some errors as below [type] => 2048 [message] => is_a(): Deprecated. Please use the instanceof operator [file] => /var/www/html/workbench/Shinod/wordpress/wp-includes/classes.php [line] => 724 Can anyone help me? ...

What portable data backends are there which have fast append and random access?

I'm working on a Qt GUI for visualizing 'live' data which is received via a TCP/IP connection. The issue is that the data is arriving rather quickly (a few dozen MB per second) - it's coming in faster than I'm able to visualize it even though I don't do any fancy visualization - I just show the data in a QTableView object. As if that's ...

How to get last access/modification date of a PostgreSQL database?

On development server I'd like to remove unused databases. To realize that I need to know if database is still used by someone or not. Is there a way to get last access or modification date of given database, schema or table? ...

H2 database and functions in separate schemas

Hi I'm trying to create a test database (with H2 database). I'm using Oracle in production, and it seems nice to have oracle compatibility mode in h2. However I've got a problem with translating oracle construction: create or replace PACKAGE permission_tools IS FUNCTION get_role_access_level( p_role_id IN NUMBER, ...

Django - Are model save() methods lazy?

Are model save() methods lazy in django? For instance, at what line in the following code sample will django hit the database? my_model = MyModel() my_model.name = 'Jeff Atwood' my_model.save() # Some code that is independent of my_model... model_id = model_instance.id print (model_id) ...

Why encrypt user passwords?

Possible Duplicate: Why arent original passwords stored? Why would one store encrypted user passwords in a database, if the password is the least valuable part of the data? It doesn't seem like it would affect external attacks; setting a limited number of login attempts per day per account would be effective. It doesn't seem l...

How do I translate a simple boolean statement to SQL?

I have the following database table with information about people, diseases, and drugs: PERSON_T DISEASE_T DRUG_T ========= ========== ======== PERSON_ID DISEASE_ID DRUG_ID GENDER PERSON_ID PERSON_ID NAME DISEASE_ST...

How to make a database appear partitioned by some columns with Active::Record

Suppose a column client_id is ubiquitous through out our database, and for a given session or request, we will be 'in the context' of a client the whole time. Is there a way to simulate having each client's data stored in a separate database, while keeping them in the same table for simpler database-management ? What I want is similar ...

How can I add a combo box using RoR helper?

I have a from like this: <% form_for(@user) do |f| %> <%= f.error_messages %> <p> <%= f.label :username %><br /> <%= f.text_field :username %> </p> <p> <%= f.label :email %><br /> <%= f.text_field :email %> </p> <p> <%= f.label :password %><br /> <%= f.password_field :password %> </p> ...

Performance of Like '%Query%' Vs Full Text Search CONTAINS Query

I have a situation where I would like to search single word. For that scenario, which Query would be good from performance point of view? Select Col1, Col2 from Table Where Col1 Like '%Search%' Or Select Col1, Col2 from Table Where Col1 CONTAINS(Col1,'Search') ...

Ensure `INSERT`s are concurrent for a specific MyISAM table?

I have a MyISAM table that basically contains a log. A cluster of machines does single-record INSERTs on this table at a rate of 50 per second tops, but the same table is also SELECTed from by a web application, and indexed to accommodate for this. There are no UPDATEs or DELETEs, though. So from what I've gathered, I should be using co...

Hibernate and Concurrency.

I have already read the hibernate docs about concurrency and I think, I have understood the available locking methods, but I am not sure how I should implement the following scenario. Two clients F (fast) and S (slow) access the database and can modify the same objects. Now, one additional requirement: It is critical to the application...

Dealing with newline character in database reports

Newbie question here. I have a web form with a text area and naturally users will enter newline characters also. I am storing this form to a table in the DB. I also have to create a report from this. So I dump the table to text and am trying to parse it. The delimiters for me between multiple records is a new line character. But the new...

Django - Keeping save() based transactions short

As django model save() methods are not lazy, and as keeping transactions short is a general good practice, should saves be preferably deferred to the end of transaction blocks? As an example, would the code sample B hold a transaction open for less time than code sample A below? Code sample A: from django.db import transaction from my...

Simple Foreign key / Create View question

What am I doing wrong? I need to create the foreign key but the code begining at CONSTRAINT is wrong somehow, also I need help with my view I think im doing the subquery wrong can you help me? CREATE TABLE dealer( dealershipId CHAR(10), phone CHAR(10), dealershipName CHAR(10), webAddress char (10), street CHAR (10), city char (10), zip ...

what should my initial size be

I'm moving a database from MySQL to SQLServer. When creating the database, what should I set the initial size to? I know the size of the imported database will be about 130MB but will grow. Should 130MB be the initial size or should I just take the default of 2MB? ...

saving an ArrayList<String> state in a SQLiteDatabase (Android)

Hi, i'm working on a android app that will display Strings to the user, and the user then has the option to add one to a favorite list. I have searched and searched and cannot find the proper way of doing this. I did get one open source project, everything worked until the user removed a favorite. The database would clear the row of data...