database

SQL Server - Copy stored procedure's from one database to other

I am trying to copy a database with huge data from SQL Server 2005 to SQL Server 2008. I tried using the Copy Database Wizard but could not use the wizard because they are two different server 2005 and 2008. So I copied all the tables using Import data wizard from SQL Server 2008. I had about 1120 stored procedures to be copied, so on ...

Model changes to widgets (price/description) over time in Rails

I recently asked this question and the answer makes alot of sense to me. Now I ponder how those answers hold up in an environment like Rails where there are plugins/gems available like, say, vestal_versions? If I'm selling widgets and the price and/or description of the item will change over time and Rails is my framework. How would you...

wil this be called distributed database?

if a db "A" created at site alpha then also schema copied at site beta which is 50 to 100 of miles away but still data in both is same and must be in syc. will it be called a distributed database or would it be wrong? EDIT why is it not distributed? its related, what does it need to be called distributed? same schema different da...

A distributed database is a collection of multiple, logically interrelated databases distributed over a computer network.

. A distributed database is a collection of multiple, logically interrelated databases distributed over a computer network. Sometimes "distributed database system" is used to refer jointly to the distributed database and the distributed DBMS. please can any one give a simple yet clear example of "multiple logically in...

SQL Referencial Integrity Between a Column and (One of Many Possible) Tables

This is more of a curiosity at the moment, but let's picture an environment where I bill on a staunch nickle&dime basis. I have many operations that my system does and they're all billable. All these operations are recorded across various tables (these tables need to be separate because they record very different kinds of information)....

MySQL tagging question: how to select an item that has been tagged as X, Y, and Z?

I'm dealing with a database where items are "tagged" a certain number of times. item (100k rows) id name other stuff tag (10k rows) id name item2tag (1,000,000 rows) item_id tag_id count I'm looking for the fastest solution to: Select items that have been tagged as X, Y, and Z (where X, Y, and Z correspond to (possibly) tag...

Speed: Saved Objects vs Database

I am designing a dynamic site for some form of weather data, which I need to scrape to get the data, as its always changing. I am interested in knowing if its faster to use a database like sqlite or to save objects ,reloading them whenever needed. Both options will hold the scraped data. Likely will use Python or Ruby, haven't decided...

how to combine 2 different table ?

Hey all how to combine 2 different tables where they contain the same fields but different data, example Cash_Expenses { exp_date exp_cat_id exp_amount exp_remark } Cheque_Espenses { exp_date exp_cat_id exp_cheque_NO exp_amount exp_remark } exp_cat { cat_id Cat_name } now what i am trying to do is that i want to combine those t...

inserting a node into SQL 2008 xml datatype... checking if it exists first

Hi, I am reading through a plethora of articles at the moment to try to assist me.. just seems so many options and cannot seem to find a clean solution.. it probably is very basic so apologies in advance! So I have an XML field in SQL 2008. It basically contains something like: <root><id>1</id><id>4</id></root> and so on... What I ...

'Splitting' ActiveRecord collection

Let's say I have two models Post and Category: class Post < ActiveRecord::Base belongs_to :category end class Category < ActiveRecord::Base has_many :posts end Is there a method that will allow me to do something like posts = Post.find(:all) p = Array.new p[1] = posts.with_category_id(1) p[2] = posts.with_category_id(2) p[3] =...

DB to run on OS X server that will sync nicely with Core Data on iOS?

I am trying to plan out a few iOS/server apps for internal use. On the iOS side I'll use Core Data, but I'm not so sure what many people do on the server side. I will be running a Mac Mini with OS X Server 10.6.X. This app will need to sync when the iOS device is on the internal WiFi as well as over 3G. Some of this data will need to be ...

Whats the most efficient way to store an array of integers in a MySQL column?

I've got two tables A: plant_ID | name. 1 | tree 2 | shrubbery 20 | notashrubbery B: area_ID | name | plants 1 | forrest | *needhelphere* now I want the area to store any number of plants, in a specific order and some plants might show up a number of times: e.g 2,20,1,2,2,20,1 Whats the most effic...

codeigniter how i can load two diffrent mysql table list in single view

I want to develop a edit form for newsletter. I have done this but i can't load category list in same view. if user click on newsletter its open in edit view, in this edit view i want to give him a option for category selection option. categories are stored in different table name cat. i have tried it but its showing only one category....

Hibernate HQL NULL comparison pattern

Imagine a simple web page allowing you to search Bookings like this: If the Booking Number field is not populated I want to return all rows. If the Booking Number field is populated I only want to return that row. I have been using a pattern in Hibernate (with an underlying MySQL database) to accomplish this that goes something lik...

What are best practices for removing "friends" from a database?

Say you have a table schema such as this: friends(friendship_id, uid1, uid2, are_friends). When one friend un-friends another person, is it best practice to delete that row from the database (and reset auto-incrementing)? Or should you simply change the are_friends status to 'N'? I'd love to know what you think and why. EDIT: My prima...

Inventory Management System in 3 Hours?

Inventory Requisition Process: Whenever a user requires inventory, user generates an inventory requisition, and if the inventory is available, the inventory will be directly issued and user’s inventory account will be updated. In case the inventory is not available, the purchase order will be generated for the required inventory to the c...

back up a database

Hi everyone, I need to back up a big database everydays. Should I code it myself in PHP or is there a good script out there ? ...

SQL FOREIGN KEY USAGE ? what does it really do ? and when it was needed ?

ok im makeing a simple database for my example, there is users data and the user company's data . CREATE TABLE `users` ( `UID` INT(25) NOT NULL AUTO_INCREMENT , `username` VARCHAR(60) NOT NULL , `password` VARCHAR(100) NOT NULL , `ownername` VARCHAR(150) NOT NULL , `userstatus` TINYINT(1) NOT NULL , `userregistertime` DATETI...

How to Depoly Vb.net Application containing Crystal Report and Access Database file

Hi guys, I am trying to build a setup file which will install my vb.net application with database and crystal report files to the client. 1.) I created my vb.net application in release mode. 2.) I created new setup project and added my vb.net application project in that solution. 3.) Also added the primary output in application fold...

WPF Data-Bound Datagrid Filtering / Searching

Hi guys, I have a WPF application which uses a (currently) local database to act as a binding source. Using the Visual Studio 2010 tools I have a LINQ-SQL model which acts as the Datacontext for most forms. What I have is a UserControl with a TextBox and Datagrid. The datagrid ItemSource is set upon the UserControl.Loaded event with a ...