Showing posts with label point. Show all posts
Showing posts with label point. Show all posts

Wednesday, March 28, 2012

query "For XML" problem?...or not!

hi guys

i'm developing a multi-tier web application which at a given point calls a stored procedure that returns data formated as XML ( 'select .... for xml auto' basically).

That SP returns a list of tasks allocated to 1 or more resources.

The problem is that from time to time (and that is totally random, anything from 30seconds to 10mins) whenever the code calls that SP, the XML structure isn't there, so no data is listed.

Question is: is this a problem within SQL Server XML support or anything related to .NET?

I'm using .NET 2.0.50727 with VS2005 8.0.50727.42, and SQL Server 2005 and IE 6.0.2900

Also, if i refresh the browser and go to the Task listing page, the list comes back again!

Note that i'm NOT using SESSIONs in ANY point, so this has nothing to do with sessions.

TIA

Sérgio Charrua
www.pdmfc.com
Portugal


Hi Sergio,

SQL Server XML support is very useful for some issues. But It isn't scalable solution.

Good Coding!

Javier Luna
http://guydotnetxmlwebservices.blogspot.com/

|||It's diffcult to figure out what's causing the problem. From SQL side, if a SP returns XML data, it just returns a binary stream to the client as other returned data. I suggest you open SQL Profiler to trace the SQL Server when the prolbem repros, so that you can clarify whehter SQL returns expected result set or empty (none) result, or maybe some network issue.sql

Tuesday, March 20, 2012

queries

If I am not in the right newsgroup, please point me to the correct one, I
did not see one that involves queries.
How can I do a query from 2 tables to see which table does not have the same
number of records per person as the 2nd table? I hope that makes sense.
For instance, I have a client table, then 2 other tables related to each
client. One table has invoices, the other has invoices paid (they are
separate tables for other reasons). I want to know which clients have a
different number of invoices than they do invoices paid.
Probably a good question for the .programming group. Can you follow up
there will DDL, sample data and desired results?
http://www.aspfaq.com/
(Reverse address to reply.)
"Rock" <rockisland@.yahoo.com> wrote in message
news:#yFTZfb0EHA.1392@.tk2msftngp13.phx.gbl...
> If I am not in the right newsgroup, please point me to the correct one, I
> did not see one that involves queries.
> How can I do a query from 2 tables to see which table does not have the
same
> number of records per person as the 2nd table? I hope that makes sense.
> For instance, I have a client table, then 2 other tables related to each
> client. One table has invoices, the other has invoices paid (they are
> separate tables for other reasons). I want to know which clients have a
> different number of invoices than they do invoices paid.
>
>
|||As Aaron suggested we really need to see DDL, sample data and expect results
to understand your problem fully. Various questions come to mind. What are
the keys of these tables? Is there a foreign key between them and if so,
what? Do you actually want a count of the invoices or do you just want to
find customers with invoices that don't appear in both tables?
One of these may help. For the first two queries I've assumed that
Invoice_No is the primary key in both tables.
SELECT DISTINCT I.client_id
FROM Invoices AS I
LEFT JOIN PaidInvoices AS P
ON I.invoice_no = P.invoice_no
WHERE P.invoice_no IS NULL
SELECT DISTINCT I.client_id
FROM Invoices AS I
FULL JOIN PaidInvoices AS P
ON I.invoice_no = P.invoice_no
WHERE P.invoice_no IS NULL
OR I.invoice_no IS NULL
SELECT I.client_id, I.invoiced, P.paid
FROM
(SELECT client_id, COUNT(*) AS invoiced
FROM Invoices
GROUP BY client_id) AS I,
(SELECT client_id, COUNT(*) AS paid
FROM PaidInvoices
GROUP BY client_id) AS P
WHERE I.client_id = P.client_id
David Portas
SQL Server MVP
|||Rock,
--This will return all unpaid bills
SELECT * FROM invoices
WHERE NOT EXISTS(SELECT * FROM invoices_paid WHERE
invoices_paid.id=invoices.id)
--This will return all clients and the number of unpaid bills
SELECT COUNT(invoices.id), clients.clients_id FROM invoices
JOIN clients ON clients.clients_id=invoices.clients.id
WHERE NOT EXISTS(SELECT * FROM invoices_paid WHERE
invoices_paid.id=invoices.id)
GROUP BY invoices.id, clients.clients
Regards, Gerald.
"Rock" <rockisland@.yahoo.com> schrieb im Newsbeitrag
news:%23yFTZfb0EHA.1392@.tk2msftngp13.phx.gbl...
> If I am not in the right newsgroup, please point me to the correct one, I
> did not see one that involves queries.
> How can I do a query from 2 tables to see which table does not have the
> same
> number of records per person as the 2nd table? I hope that makes sense.
> For instance, I have a client table, then 2 other tables related to each
> client. One table has invoices, the other has invoices paid (they are
> separate tables for other reasons). I want to know which clients have a
> different number of invoices than they do invoices paid.
>
>

queries

If I am not in the right newsgroup, please point me to the correct one, I
did not see one that involves queries.
How can I do a query from 2 tables to see which table does not have the same
number of records per person as the 2nd table? I hope that makes sense.
For instance, I have a client table, then 2 other tables related to each
client. One table has invoices, the other has invoices paid (they are
separate tables for other reasons). I want to know which clients have a
different number of invoices than they do invoices paid.Probably a good question for the .programming group. Can you follow up
there will DDL, sample data and desired results?
http://www.aspfaq.com/
(Reverse address to reply.)
"Rock" <rockisland@.yahoo.com> wrote in message
news:#yFTZfb0EHA.1392@.tk2msftngp13.phx.gbl...
> If I am not in the right newsgroup, please point me to the correct one, I
> did not see one that involves queries.
> How can I do a query from 2 tables to see which table does not have the
same
> number of records per person as the 2nd table? I hope that makes sense.
> For instance, I have a client table, then 2 other tables related to each
> client. One table has invoices, the other has invoices paid (they are
> separate tables for other reasons). I want to know which clients have a
> different number of invoices than they do invoices paid.
>
>|||As Aaron suggested we really need to see DDL, sample data and expect results
to understand your problem fully. Various questions come to mind. What are
the keys of these tables? Is there a foreign key between them and if so,
what? Do you actually want a count of the invoices or do you just want to
find customers with invoices that don't appear in both tables?
One of these may help. For the first two queries I've assumed that
Invoice_No is the primary key in both tables.
SELECT DISTINCT I.client_id
FROM Invoices AS I
LEFT JOIN PaidInvoices AS P
ON I.invoice_no = P.invoice_no
WHERE P.invoice_no IS NULL
SELECT DISTINCT I.client_id
FROM Invoices AS I
FULL JOIN PaidInvoices AS P
ON I.invoice_no = P.invoice_no
WHERE P.invoice_no IS NULL
OR I.invoice_no IS NULL
SELECT I.client_id, I.invoiced, P.paid
FROM
(SELECT client_id, COUNT(*) AS invoiced
FROM Invoices
GROUP BY client_id) AS I,
(SELECT client_id, COUNT(*) AS paid
FROM PaidInvoices
GROUP BY client_id) AS P
WHERE I.client_id = P.client_id
David Portas
SQL Server MVP
--|||Rock,
--This will return all unpaid bills
SELECT * FROM invoices
WHERE NOT EXISTS(SELECT * FROM invoices_paid WHERE
invoices_paid.id=invoices.id)
--This will return all clients and the number of unpaid bills
SELECT COUNT(invoices.id), clients.clients_id FROM invoices
JOIN clients ON clients.clients_id=invoices.clients.id
WHERE NOT EXISTS(SELECT * FROM invoices_paid WHERE
invoices_paid.id=invoices.id)
GROUP BY invoices.id, clients.clients
Regards, Gerald.
"Rock" <rockisland@.yahoo.com> schrieb im Newsbeitrag
news:%23yFTZfb0EHA.1392@.tk2msftngp13.phx.gbl...
> If I am not in the right newsgroup, please point me to the correct one, I
> did not see one that involves queries.
> How can I do a query from 2 tables to see which table does not have the
> same
> number of records per person as the 2nd table? I hope that makes sense.
> For instance, I have a client table, then 2 other tables related to each
> client. One table has invoices, the other has invoices paid (they are
> separate tables for other reasons). I want to know which clients have a
> different number of invoices than they do invoices paid.
>
>

queries

If I am not in the right newsgroup, please point me to the correct one, I
did not see one that involves queries.
How can I do a query from 2 tables to see which table does not have the same
number of records per person as the 2nd table? I hope that makes sense.
For instance, I have a client table, then 2 other tables related to each
client. One table has invoices, the other has invoices paid (they are
separate tables for other reasons). I want to know which clients have a
different number of invoices than they do invoices paid.Probably a good question for the .programming group. Can you follow up
there will DDL, sample data and desired results?
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Rock" <rockisland@.yahoo.com> wrote in message
news:#yFTZfb0EHA.1392@.tk2msftngp13.phx.gbl...
> If I am not in the right newsgroup, please point me to the correct one, I
> did not see one that involves queries.
> How can I do a query from 2 tables to see which table does not have the
same
> number of records per person as the 2nd table? I hope that makes sense.
> For instance, I have a client table, then 2 other tables related to each
> client. One table has invoices, the other has invoices paid (they are
> separate tables for other reasons). I want to know which clients have a
> different number of invoices than they do invoices paid.
>
>|||As Aaron suggested we really need to see DDL, sample data and expect results
to understand your problem fully. Various questions come to mind. What are
the keys of these tables? Is there a foreign key between them and if so,
what? Do you actually want a count of the invoices or do you just want to
find customers with invoices that don't appear in both tables?
One of these may help. For the first two queries I've assumed that
Invoice_No is the primary key in both tables.
SELECT DISTINCT I.client_id
FROM Invoices AS I
LEFT JOIN PaidInvoices AS P
ON I.invoice_no = P.invoice_no
WHERE P.invoice_no IS NULL
SELECT DISTINCT I.client_id
FROM Invoices AS I
FULL JOIN PaidInvoices AS P
ON I.invoice_no = P.invoice_no
WHERE P.invoice_no IS NULL
OR I.invoice_no IS NULL
SELECT I.client_id, I.invoiced, P.paid
FROM
(SELECT client_id, COUNT(*) AS invoiced
FROM Invoices
GROUP BY client_id) AS I,
(SELECT client_id, COUNT(*) AS paid
FROM PaidInvoices
GROUP BY client_id) AS P
WHERE I.client_id = P.client_id
--
David Portas
SQL Server MVP
--|||Rock,
--This will return all unpaid bills
SELECT * FROM invoices
WHERE NOT EXISTS(SELECT * FROM invoices_paid WHERE
invoices_paid.id=invoices.id)
--This will return all clients and the number of unpaid bills
SELECT COUNT(invoices.id), clients.clients_id FROM invoices
JOIN clients ON clients.clients_id=invoices.clients.id
WHERE NOT EXISTS(SELECT * FROM invoices_paid WHERE
invoices_paid.id=invoices.id)
GROUP BY invoices.id, clients.clients
Regards, Gerald.
"Rock" <rockisland@.yahoo.com> schrieb im Newsbeitrag
news:%23yFTZfb0EHA.1392@.tk2msftngp13.phx.gbl...
> If I am not in the right newsgroup, please point me to the correct one, I
> did not see one that involves queries.
> How can I do a query from 2 tables to see which table does not have the
> same
> number of records per person as the 2nd table? I hope that makes sense.
> For instance, I have a client table, then 2 other tables related to each
> client. One table has invoices, the other has invoices paid (they are
> separate tables for other reasons). I want to know which clients have a
> different number of invoices than they do invoices paid.
>
>

Friday, March 9, 2012

QA Setup question

I know that this is just a very small point, but it bugs me and I
wonder if there is a work around. When I use an old version of QA
(version 8.000.194) keywords are properly highlighted. When I run a
more recent version (8.000.760), some are, but some (FROM, WHERE, AND,
etc) are not. Is there a fix for this? Thanks.
-Johntry going to Tools-->Options-->Fonts
Then select keyword in the colors panel and set it to the correct
color, see if that helps
http://sqlservercode.blogspot.com/|||"SQL" <denis.gobo@.gmail.com> wrote:

>try going to Tools-->Options-->Fonts
>Then select keyword in the colors panel and set it to the correct
>color, see if that helps
>
That's exactly what I'm doing and I'm not getting the color change on
come keywords.
-John|||Can you try clicking "reset all".
"John Baima" <john@.nospam.com> wrote in message
news:gltns1dcib24om49o5m32jmme5m7jje3c9@.
4ax.com...
> "SQL" <denis.gobo@.gmail.com> wrote:
>
> That's exactly what I'm doing and I'm not getting the color change on
> come keywords.
> -John
>|||"Raymond D'Anjou" <rdanjou@.canatradeNOSPAM.com> wrote:
>Can you try clicking "reset all".
>"John Baima" <john@.nospam.com> wrote in message
> news:gltns1dcib24om49o5m32jmme5m7jje3c9@.
4ax.com...
No, that does not change anything. Again, some keywords are
highlighted, but not all. The versions are different. What is the
latest and greatest version number for QA'
-John|||John Baima (john@.nospam.com) writes:
> I know that this is just a very small point, but it bugs me and I
> wonder if there is a work around. When I use an old version of QA
> (version 8.000.194) keywords are properly highlighted. When I run a
> more recent version (8.000.760), some are, but some (FROM, WHERE, AND,
> etc) are not. Is there a fix for this? Thanks.
In another case I heard of this, no words were highlighted. The suggestion
then was to run
regsvr32 "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\sqllex.dll"
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Erland Sommarskog <esquel@.sommarskog.se> wrote:

>John Baima (john@.nospam.com) writes:
>In another case I heard of this, no words were highlighted. The suggestion
>then was to run
> regsvr32 "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\sqllex.dll"
That was a little scary, but it did the trick! Thanks!
-John

Q319697

SQL Enterprise Manager Restore to Point in Time Does Not
Stop at Requested Time
and the Database is Left in a Loading State 'Q319697'
Has anybody had problems similar to the one high-lighted
in Q319697.
Earlier this week I tried to Recover a database to a
specific point in time
but the restore went to the end of the file.
I have SP3 and MS03-031 hot fix installed both on my PC
and the server I was restoring to.
The Knowledge base article says that it is fixed in SP3,
has MS03-031 caused this?
After the initial panic I managed to restore the database
using SQL.
GaryI have the same problem that you describe even if I have SP3 installed.. Th
is is not related to MS03-031 hot fix because I don't have installed this on
e

Q319697

SQL Enterprise Manager Restore to Point in Time Does Not
Stop at Requested Time
and the Database is Left in a Loading State 'Q319697'
Has anybody had problems similar to the one high-lighted
in Q319697.
Earlier this week I tried to Recover a database to a
specific point in time
but the restore went to the end of the file.
I have SP3 and MS03-031 hot fix installed both on my PC
and the server I was restoring to.
The Knowledge base article says that it is fixed in SP3,
has MS03-031 caused this?
After the initial panic I managed to restore the database
using SQL.
GaryI have the same problem that you describe even if I have SP3 installed.. This is not related to MS03-031 hot fix because I don't have installed this one