I have 2 tables: "products" and "pieces"
PRODUCTS
idProd
product
price
PIECES
id
idProdMain
idProdChild
quant
idProdMain and idProdChild are related with the table: "products".
Other considerations is that 1 product can have some pieces and 1 product can be a piece.
Price product equal a sum of quantity * price of all their pie...
hello
let's say mysql is something like this
select x,y
from xx
group by y
i want to know how many rows that select will get, i tried to use count but it will n't return all results since i'm using group by.
how to do that?
Thanks
...
For some reason I can't get DTA to connect to my development machine. It connects to a remote DB just fine but when I point it to my dev machine I get an error saying:
Failed to initialize MSDB database for tuning (exit code: -1073741819).
I'm pretty sure it's not a permissions issue since I've used profiler to capture what it's doing ...
I would like to better understand the basic steps needed to a take an XML document like this Breakfast Menu...
<?xml version="1.0" encoding="ISO-8859-1"?>
<breakfast_menu>
<food>
<name>Belgian Waffles</name>
<price>$5.95</price>
<description>two of our famous Belgian Waffles with plenty of real maple syrup</d...
I have something like that:
to_days(now()) < to_days(birth)
It work but instead of comparing days I was to compare the time too. Is there a similar function?
...
I'm currently writing a website in ASP.NET MVC, and my database (which doesn't have any data in it yet, it only has the correct tables) uses SQL Server 2008, which I have installed on my development machine. I connect to the database out of my application by using the Server Explorer, followed by LINQ to SQL mapping.
Once I finish deve...
i try to write a generator or i want to write all stored procedures(SP) in C# side. how can i do that?
1) writing a sp generator OR
2) Coding all sps via C# OR
3) Writing All data process (SP) via Linq
which one is best or your advise?
...
I have a database that keeps record history. For each update to a record, the system will "deactivate" the previous record (along with all it's children), by setting the "Status" column to "0".
Now it's not a problem yet...but eventually this system is going to have a lot of records, and history is more important than speed right now. B...
I am install an c# winforms app 3.5 to a client that references a mdf file that will in SQL server express.
I installed .net 3.5 sp1 so the latest .net data providers for SQL server should be there??
I am getting an error for system.data and the above dll. What are the dependencies am I missing?
...
I have the following tables:
CREATE TABLE title (
booktitle VARCHAR( 60 ),
title_id CHAR( 6 ),
au_id CHAR( 11 ),
PRIMARY KEY (title_id)
)
create table authors (
au_id char(11),
au_lname varchar(20),
au_fname varchar(20),
phone varchar(10),
address varchar(30),
city varchar(20),
state char(2),
zip char(5));
I ne...
I have a table whose columns are varchar(50) and a float. I need to (very quickly) look get the float associated with a given string. Even with indexing, this is rather slow.
I know, however, that each string is associated with an integer, which I know at the time of lookup, so that each string maps to a unique integer, but each integer...
Guys,
Here is the scenario:
SQL Server 2000 (8.0.2055)
Table currently has 478 million rows of data. The Primary Key column is an INT with IDENTITY. There is an Unique Constraint imposed on two other columns with a Non-Clustered Index. This is a vendor application and we are only responsible for maintaining the DB.
Now the vendor has...
I am creating a WPF app that needs to allow users to work in a temporary disconnected state and I plan to use a Local Database Cache.
My question's are about my data access layer.
Do you typically create the whole DAL
to point at the Cache or both and
create a switching mechanism?
Is Entity's a good way to go for my
DAL against the ...
I have postgresql (in perlu) function getTravelTime(integer, timestamp), which tries to select data for specified ID and timestamp. If there are no data or if data is old, it downloads them from external server (downloading time ~300ms).
Multiple process use this database and this function. There is an error when two process do not fin...
I feel totally stupid. I'm rusty with my sql.
I have two tables, Message and MessageThread. Each message belongs to one MessageThread using ParentTHreadID as a Foreign Key. You probably can see where this is going.
Well, I want to do something like this. I want to get columns from both tables, messages and threads, but where the mes...
Hello all,
I have a table let's say in the form of: match(id, hometeam_id, awayteam_id) and team(id, name). How do I build my SQL query in order to get a result table in the form of (match_id, hometeam_name, awayteam_name), since they both (hometeam_id, awayteam_id) reference the same table (team)?
Thank you
...
How do you specify the the row terminator when outputting query results using sqlcmd?
bcp is not an option.
sqlcmd -E -s" " -Q "Select * From SomeTable" -o C:\Output.txt -W
What is the default row terminator?
...
I've been trying to get a delete to cascade and it just doesn't seem to work. I'm sure I am missing something obvious, can anyone help me find it?
I would expect a delete on the 'articles' table to trigger a delete on the corresponding rows in the 'article_section_lt' table.
CREATE TABLE articles (
id INTEGER UNSIGNED PRIMARY KEY...
In an RPG program (One of IBM's languages on the AS/400) I can "chain" out to a file to see if a record (say, a certain customer record) exists in the file. If it does, then I can update that record instantly with new data. If the record doesn't exist, I can write a new record. The code would look like this:
Customer Chain CustFile ...
Hey guys,
My OSCommerce site includes a separately programmed feature for which I use SQL tables. I've decided to host its tables on a remote site offering free SQL accounts. I'd like to know if there could be any disadvantages to this approach.
Thanks
Syd
...