database

Sorted result differs with inner and left joins in mysql

I just found this irregularitry in a query i made, why does the result differ when using inner and left joins? for one, the result is ordered both in the temporary hit table and in the final query? I made a little example to show the problem: # cleanup drop temporary table if exists ids; drop temporary table if exists arts; # create t...

How to display all the types that i've created using "CREATE TYPE" in postgresql?

HI, this might sound like a silly question but.. i've created several "types" in a database using the CREATE TYPE command, now i'd like to use the same types in a different database in a different server and i didn't save my CREATE TYPE statements. Is there a way to export the types?? or even display the list of types with their fields a...

How to copy a Visual Studio database unit test

I'm writing unit tests for stored procedures in VSTE for Database Professionals, and want to copy some already existing test cases that only need to be modified in a few places. Manually re-creating them would be very tedious. I couldn't find a solution either on the web or in books. Any ideas are welcome. ...

Help on a SQL Query

In a previous Post, I was doing a very simple database with 3 tables "doctor", "patient" and "visit". I've tried to make it more realistic and included now a many to many relationship between "doctor" and "patient". "visit" is the table resulting in this n-m relation. I assume the following simple structure for my table : doctor - idD...

How many is too many databases on SQL Server?

I am working with an application where we store our client data in separate SQL databases for each client. So far this has worked great, there was even a case where some bad code selected the wrong customer ids from the database and since the only data in the database belonged to that client, the damage was not as bad as it could have b...

Database Normalization

I'm new to database design and I have been reading quite a bit about normalization. If I had three tables: Accommodation, Train Stations and Airports. Would I have address columns in each table or an address table that is referenced by the other tables? Is there such a thing as over-normalization? Thanks ...

How to convert char into an array in Informix database?

I have a stored procedure like this: CREATE PROCEDURE Proc_Test(testvalue set(char(1000) not null)) RETURNING int; DEFINE z char(7000); LET z = ' '; FOREACH select * into z from table(testvalue) END FOREACH; return 1; end procedure; Due to the change in the requirement I would like to change this stored procedure as:...

Database design guidance needed

A dairy farmer, who is also a part-time cartoonist, has several herds of cows. He has assigned each cow to a particular herd. In each herd, the farmer has one cow that is his favorite - often that cow is featured in a cartoon. A few malcontents in each herd, mainly those who feel they should have appeared in the cartoon, disagree with t...

concat tables with different content

Hi, I am currently building a small web application for publishing stories using PHP and MySQL. Each story may either be a article (with lots of fields and data), just a hyperlink/url, just an image, or a downloadable file with certain attributes (once again with lots of fields). My problem is related to finding the optimal database la...

Update mySQL table based on row=column name

A little background so you understand what I'm trying to do. I am making a page that takes two user input products and checks to see if they are compatible with one another. This is an n+1*n mySQL table because there are n products. The table looks like name a b c d e a b c d e I already know that every product is comp...

How can i import indexes into ms SQL Server?

I created a new databases , and added tables using the import data wizard. But the wizard din't create the indexed and constraint's on the table. How can I Import indexes? ...

Add new row to gridview

I'm using a gridview to display and access a sql database and using databinding. I'm also using autogenerate columns as one gridview has multiple sources and toggles between them. What would be the best way to allow the user to insert a new row? Would a listview be better? ...

database of products images

Hi, I'm looking for a database of images of products (e.g. iPhone, Sony TV set, a Porche car) that I can freely use in my ecommerce site. I don't wish to hotlink - I'd be happy to host the images on my site, but wish to do so legaly. Thanks in advance for any help! Daniel ...

Trackablecollection problem in EF

I newbie in EF. I have Table A linked together to table B, by passing a primary ID from table A which is a secondary ID on table B Iam trying to retrieve an object from table B. But I am getting trackableCollection'1[Object name(from table B)] Any suggestions? I am trying to retrieve using stored proc here is the code: select * from t...

SQL Updated since last visit column

I'm working with SQL Server and I'm pretty new to SQL in general, so if this is a very trivial question, please bear with me. I have a table in a database with a datetime field representing some timestamp. When extracting the table via a SELECT statement, I would like to have a column of True/False representing whether or not the row ha...

How to do an inner join in Android?

I would like to do an inner join on my database in my Android app. Is this even possible? What about a left join? I know cursor joiner exists but the documentation isn't clear at all. Can anyone provide any further insight? Thanks ...

File-based options for datasource in .NET application

I'm in the process of developing a .NET application that needs to be able to run without a database engine installed on the target machine. It's predecessor used an mdb file to achieve this. Is there a better alternative now? The database will only have one user in 90% of cases. In the other 10% an standard SQL Server would be used. ...

Any good method to store Multiple Selection Value in database?

Hi there, What I am currently know is that use bitwise and Int type to store multiple selection value in Database. Take Sql Server 2008 as a example, 'Int' type in sql server is 32bit, so it accepts 32 answer, I only can use 1,2,4,8,16, etc to represent the answer, due to I need to store the multiple selection into one value, and use b...

Databinding in WPF (C#)

Hello, sorry for any inconveniece caused. Would like to ask about database or rather databinding My Window look like this: http://i25.tinypic.com/a0x5kn.jpg The browse button is look up the "My Network Place" private void browseBtn_Click(object sender, RoutedEventArgs e) { FolderBrowserDialog dialog = new FolderBrowserDialog(); Ty...

How to choose optimized datatypes for columns [innodb specific]?

I'm learning about the usage of datatypes for databases. For example: Which is better for email? varchar[100], char[100], or tinyint (joking) Which is better for username? should I use int, bigint, or varchar? Explain. Some of my friends say that if we use int, bigint, or another numeric datatype it will be better (facebook does it). ...