I am trying to put together db design for storing images. Many of you might have had experience designing db to store images and the challenges associated with it.
The db might store hundreds of thousands of images eventually. I am planning to use SQL Server 2008 db and entity framework. Planning to use FILESTREAM datatype for storing ...
I have a table of data with column names:
period, Truck, Car, Boat
Where the Columns contain numeric values, and the period column is an identity column having 1 to 48, so there are 48 rows.
I would like to massage this table into a format where I have a Name column and a value column as well as the period column eg.
period, NameOfV...
I've run across multiple situations in the last few months where legacy sql SP's are returning a single table made up mostly of redundant information.
Example:
Select CustomerID, CustomerEmail, CustomerAddress, InventoryLineItem, ShipQty from ...
Returns:
55 [email protected] 723 StreetName InvLineItem#1 45
55 [email protected] 723 StreetName InvLineIt...
Looking at JOIN's this weekend.
I was reading up on Join and seeing a ton of combinations of JOIN, LEFT, RIGHT, OUTER, FULL, INNER. I checked the MSDN docs and it looks like the only allowed combinations are in the form:
< join_type > ::=
[ INNER | { { LEFT | RIGHT | FULL } [ OUTER] } ]
[ < join_hint > ]
JOIN
so from tha...
Hi. Sorry for the horrible title, not sure how to explain this. I have a query that looks like this:
SELECT `name`, `latitude`, `longitude`, `indoor`, `address`,
`phone`, `email`, `website`, `closed`
FROM rocks INNER JOIN
(SELECT DISTINCT id FROM rock_types WHERE type="DWS" or type="Top rope")
AS types ON rocks.id=types.id
...
I am using SQl data reader to get value from SQL database.
Language VB.NET
After getting data into reader, i run a while loop
While reader.Read
If reader.HasRows() Then
/* Proessing of data */
End If
End While
I observe that the while loop takes a lot of time to process as there are many rows.
Is there any bett...
Hi guys,
I'm wondering how to create SQL query to get messages only from people I follow. I assume that create a SQL join query is the right way but I don't know how. Please could someone help me?
I have these three tables now:
CREATE TABLE `users` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`username` VARCHAR( 255 ) NOT NULL ,
`...
In MySQL I can use the RAND() function, is there any alternative in SQLite 3?
...
I'm using mysql
there are two tables
vote
app_id user_id
2 1
3 1
2 2
app
id title content
1 xx xxxx
2 yy yyyy
3 zz zzzz
I want to sort app table by the number of user's vote . in this example , the result should be
id title content
2 yy yyyy
3 zz zzzz
1 xx xxxx
any suggestion?
...
I have a data-analysis question, that I could easily solve with some T-SQL or some scripting, but I was wondering if there was a clever SQL solution. The problem is that it messes a bit with SQL's row-independence assumption a bit.
I have a table that consists of name-value pairs associated with a user and ordered by submission, for exa...
How can I store and retrieve an image to a MySQL database using VB.NET 2005?
...
I have a table, let's call it 'entries' that looks like this (simplified):
id [pk]
user_id [fk]
created [date]
processed [boolean, default false]
and I want to create an UPDATE query which will set the processed flag to true on all entries except for the latest 3 for each user (latest in terms of the created column). So, for the follo...
I am aware of COLUMNS_UPDATED, well I need some quick shortcut (if anyone has made, I am already making one, but if anyone can save my time, I will appriciate it)
I need basicaly an XML of only updated column values, I need this for replication purpose.
SELECT * FROM inserted gives me each column, but I need only updated ones.
somethi...
Think about a table like this
ID Value
100 1
100 3
101 1
101 4
102 2
102 5
103 2
103 4
104 1
104 3
105 2
105 5
The problem is, if I give values 2 and 5 I should get 102 and 105 which both 102 and 105 are having values 2 and 5 at the same time or if...
I have created several SQL database change scripts, and placed them in a folder. Is there an easy way of combining a few of them into one file or executable so that it's easier for my partner to execute them on his database?
Thanks for any help!
...
I am trying to have a PostBuildEvent in my SSIS project. This is my original .DTProj file from a test project with one test package.
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ProductVersion>10.0.2531.0</ProductVersion>
<Sche...
Hi all,
I have used this type of functionality before but is MSSQL but can't get it to work for Oracle, any tips?
DECLARE
MY_TBL NUMBER := 1;
BEGIN
IF(MY_TBL > 0) THEN
SELECT * FROM MY_TBL ORDER BY MY_TBL_ID DESC;
END IF;
END;
What I would like to have is a flag variable set to zero or one, if one display the re...
Hi everyone,
I'm executing simple insert query like below:
INSERT INTO tbl_destination ...
SELECT ... FROM [SomeOtherLinkedServer].tbl_source
It results in 3'000'000 rows inserted to the destination table although the SELECT returns the 9'000'000 rows. What can be the cause?
I'm using SQL Servers 2005 Standard edition. The destination t...
Hi guys,
I am having trouble with a SQL join question.
I have a table EMPLOYEE with EmpID, FirstName, LastName, Email, Phone
I have another table OTHERNAME with 2 fields "Name" & "OtherName".
This table contains lookup values such as "James", "Jim"; "Thomas", "Tom"; "Steven", "Steve".
I want to write a query which will return rows
E...
Say I've got a table:
create table foo (
corp_id int not null,
tdate date not null,
sec_id int unsigned not null,
amount int unsigned not null,
primary key (corp_id, sec_id, tdate)
);
The following query will return the sum of the amount column for all corp_id's and dates:
select corp_id, tdate, sum(amount) from foo group b...