Monday, March 26, 2012
Fetching sungle record from join
I have a table, say T1 and this has a child tabel named T2. The common column between the tables are say COL. Now the scenario is there are multiples of records in the T2 for each record in table T1.
Now when i make a join of both the tables, say INNER JOIN, it returns the number of records based on the child table. i.e. say for a record in T1 there are 3 records in T2. Then through the INNER JOIN i will be getting the 3 records. But need only one record from the join. Have tried with "SET ROWCOUNT 1". But as you all know that this will not work. Kind suggest me the way friends......:eek: :eek: :eek:
Thanks,
Rahul JhaHello folks,
I have a table, say T1 and this has a child tabel named T2. The common column between the tables are say COL. Now the scenario is there are multiples of records in the T2 for each record in table T1.
Now when i make a join of both the tables, say INNER JOIN, it returns the number of records based on the child table. i.e. say for a record in T1 there are 3 records in T2. Then through the INNER JOIN i will be getting the 3 records. But need only one record from the join. Have tried with "SET ROWCOUNT 1". But as you all know that this will not work. Kind suggest me the way friends......:eek: :eek: :eek:
Thanks,
Rahul Jha
Are they 3 identical records, or is there something different about them ? If they are identical you can cheese it with a distinct or a group by.|||which one do you want?|||I've never heard of a sungle record|||Rudy asks the correct question here - which of the 3 corresponding records do you want to return? And the answer "it doesn't matter/any of them" doesn't cut it ;)|||And the answer "it doesn't matter/any of them" doesn't cut it ;)Why? He could simply using MAX() or MIN() to get only one record|||MAX or MIN will of course return only one value out of the joined row
what about "the row with the max value"|||Just checking in, pulling up a chair, putting my feet up on the ottoman, leaning back, opening a beer, putting my 3-D glasses on, and waiting for the show...|||BTW, Brett, a "sungle row" is simply a Single row from amongst a Jungle of rows.|||Or he's from New Zealand|||I just might take a stab at this one.
It sounds like rows from t2 are different in some way. If you had data in t2 having to do with say a person and all of the phone numbers they could possibly have, you would get a different row for every phone number.
This is of course, if I am understanding the question correctly.
Friday, March 23, 2012
Feedback on Microsoft Connect Site
I don't know how many folks here log into the Microsoft Connect site occasionally to check suggestions and bugs submitted to Microsoft for SQL Server and SSIS (still called DTS on their list). A small pecentage? Almost everyone? (Possibly in this group.) Anyone can vote for feedback they think is important. Theoretically issues with the most votes will get Microsoft's attention first.
Links to a couple new submissions that look interesting:
1. SSMS/QA Style Message Logging for SSIS Execute SQL Tasks
2. ForEach SMO Enumerator Filtering
I vetted these issues in the forum first, so hopefully they're legitimate enough to warrant some useful feedback or even a few high fives!
Hi M.Glenn,
Those are important - thanks for pointing them out.
:{> Andy
|||Andy, thanks for the encouragement and votes. I wonder if it's common to enter a vote for your own suggestion? I'm inclined against it, but if everyone is legitimately entitled it might be helpful...
|||I generally don't. But that's just because I forget
Jamie, If that's the only reason in your opinion that's good enough for me. I'm heading for the voting booth!
(Actually, now that I've given it a little more thought it makes sense since voting is the only way to tell Microsoft how important you think the suggestion or bug is.)
|||M.Glenn wrote:
Jamie, If that's the only reason in your opinion that's good enough for me. I'm heading for the voting booth!
(Actually, now that I've given it a little more thought it makes sense since voting is the only way to tell Microsoft how important you think the suggestion or bug is.)
I would tend to think that of the majority of bug submissions that the author deems it a high priority! ;)
Never-the-less, the voting system doesn't hold a whole lot of merit to it unless the voter gives his/her feedback to back up that vote. Microsoft has listened to plenty of my submissions without even having a single vote on them. And sometimes there are those with a large number of high votes that get closed (not fixed) because of one reason or another. So it all depends, in other words.
The moral is to be sure to leave appropriate feedback when voting so that you can leave your comments which may help clarify to Microsoft what exactly the bug is and how it impacts others.
|||Phil Brammer wrote:
Microsoft has listened to plenty of my submissions without even having a single vote on them. And sometimes there are those with a large number of high votes that get closed (not fixed) because of one reason or another. So it all depends, in other words.
The moral is to be sure to leave appropriate feedback when voting so that you can leave your comments which may help clarify to Microsoft what exactly the bug is and how it impacts others.
Good information. If that's the case, votes are not as critical as the site design seems to imply. The vote tally would probably be a bigger factor if the ratio of feedback submissions to Microsoft resources was high enough to overwhelm those resources. It sounds like they're able to review pretty much everything--another sign that SSIS is a high-priority product at Microsoft.
|||I'm a firm believer that leaving a comment is much more valuable than a vote. If I were reviewing them then I would just ignore the votes cos of course most people are gonna vote high. I would want to know WHY this is important to you, how much grief has been caused without it? How could the product best be improved?
Qualititive feedback is much better than quantitive.
-Jamie
|||I basically agree with what you guys are saying, but partly because Microsoft seems to be reviewing all submissions regardless of vote count. I would add that the vote itself is providing important qualitative information--showing at-a-glance how important the issue is for reviewers/commentators.
As for the original submitter, I could easily imagine voting a 3 or 4 on my own submission if it was cosmetic or less critical to me than other things I had in the queue. Human nature being what it is though, you guys are probably right about the temptation to give one's own submission a 5 in every case.
Feedback on Microsoft Connect Site
I don't know how many folks here log into the Microsoft Connect site occasionally to check suggestions and bugs submitted to Microsoft for SQL Server and SSIS (still called DTS on their list). A small pecentage? Almost everyone? (Possibly in this group.) Anyone can vote for feedback they think is important. Theoretically issues with the most votes will get Microsoft's attention first.
Links to a couple new submissions that look interesting:
1. SSMS/QA Style Message Logging for SSIS Execute SQL Tasks
2. ForEach SMO Enumerator Filtering
I vetted these issues in the forum first, so hopefully they're legitimate enough to warrant some useful feedback or even a few high fives!
Hi M.Glenn,
Those are important - thanks for pointing them out.
:{> Andy
|||Andy, thanks for the encouragement and votes. I wonder if it's common to enter a vote for your own suggestion? I'm inclined against it, but if everyone is legitimately entitled it might be helpful...
|||I generally don't. But that's just because I forget
|||
Jamie, If that's the only reason in your opinion that's good enough for me. I'm heading for the voting booth!
(Actually, now that I've given it a little more thought it makes sense since voting is the only way to tell Microsoft how important you think the suggestion or bug is.)
|||M.Glenn wrote:
Jamie, If that's the only reason in your opinion that's good enough for me. I'm heading for the voting booth!
(Actually, now that I've given it a little more thought it makes sense since voting is the only way to tell Microsoft how important you think the suggestion or bug is.)
I would tend to think that of the majority of bug submissions that the author deems it a high priority! ;)
Never-the-less, the voting system doesn't hold a whole lot of merit to it unless the voter gives his/her feedback to back up that vote. Microsoft has listened to plenty of my submissions without even having a single vote on them. And sometimes there are those with a large number of high votes that get closed (not fixed) because of one reason or another. So it all depends, in other words.
The moral is to be sure to leave appropriate feedback when voting so that you can leave your comments which may help clarify to Microsoft what exactly the bug is and how it impacts others.
|||Phil Brammer wrote:
Microsoft has listened to plenty of my submissions without even having a single vote on them. And sometimes there are those with a large number of high votes that get closed (not fixed) because of one reason or another. So it all depends, in other words.
The moral is to be sure to leave appropriate feedback when voting so that you can leave your comments which may help clarify to Microsoft what exactly the bug is and how it impacts others.
Good information. If that's the case, votes are not as critical as the site design seems to imply. The vote tally would probably be a bigger factor if the ratio of feedback submissions to Microsoft resources was high enough to overwhelm those resources. It sounds like they're able to review pretty much everything--another sign that SSIS is a high-priority product at Microsoft.
|||
I'm a firm believer that leaving a comment is much more valuable than a vote. If I were reviewing them then I would just ignore the votes cos of course most people are gonna vote high. I would want to know WHY this is important to you, how much grief has been caused without it? How could the product best be improved?
Qualititive feedback is much better than quantitive.
-Jamie
|||
I basically agree with what you guys are saying, but partly because Microsoft seems to be reviewing all submissions regardless of vote count. I would add that the vote itself is providing important qualitative information--showing at-a-glance how important the issue is for reviewers/commentators.
As for the original submitter, I could easily imagine voting a 3 or 4 on my own submission if it was cosmetic or less critical to me than other things I had in the queue. Human nature being what it is though, you guys are probably right about the temptation to give one's own submission a 5 in every case.
Feedback from Tape Backups
I'm trying to find a way to get access to the STATS output from the BACKUP
command during automated backups.
When running the BACKUP command in QA it shows the output, line by line, as
the backup progresses. Is there any way I can get this information when the
BACKUP statement is run from a job? I thought the console tool might have
been the answer, but it doesn't show any progress messages.
Is the only option to use the Job/Step/Adv/Output to file option, and "tail"
the file?
TIA
J.
In this case, the client application is SQL Server Agent, more specific, the sub-component in Agent
that executes your TSQL job steps. And Agent isn't written to output this information "as it goes".
It might update the output file as information comes in (I haven't tested this), so I think that
this is probably your best bet. Another option is of course to schedule an EXE file that you wrote
and you have in your EXE file code to output the information to where ever you want it to go.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"J Hunter" <ms-nntp-nospam@.jshunter.co.uk> wrote in message
news:eL976GjHFHA.1860@.TK2MSFTNGP15.phx.gbl...
> Hi Folks,
> I'm trying to find a way to get access to the STATS output from the BACKUP
> command during automated backups.
> When running the BACKUP command in QA it shows the output, line by line, as
> the backup progresses. Is there any way I can get this information when the
> BACKUP statement is run from a job? I thought the console tool might have
> been the answer, but it doesn't show any progress messages.
> Is the only option to use the Job/Step/Adv/Output to file option, and "tail"
> the file?
> TIA
> J.
>
>
|||Thanks Tibor
With regard to your comments on creating my own EXE, how would I go about
getting access to the messages - given that they are not returned as part of
a result set?
Cheers
J.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OU%23Lr5lHFHA.4060@.TK2MSFTNGP14.phx.gbl...
> In this case, the client application is SQL Server Agent, more specific,
the sub-component in Agent
> that executes your TSQL job steps. And Agent isn't written to output this
information "as it goes".
> It might update the output file as information comes in (I haven't tested
this), so I think that
> this is probably your best bet. Another option is of course to schedule an
EXE file that you wrote
> and you have in your EXE file code to output the information to where ever
you want it to go.[vbcol=seagreen]
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "J Hunter" <ms-nntp-nospam@.jshunter.co.uk> wrote in message
> news:eL976GjHFHA.1860@.TK2MSFTNGP15.phx.gbl...
BACKUP[vbcol=seagreen]
as[vbcol=seagreen]
the[vbcol=seagreen]
have[vbcol=seagreen]
"tail"
>
|||First I believe that you have to program asynchronously. Otherwise the command will be blocked until
it has finished. These are returned as messages, technically same way as PRINT and errors. I'm no
API expert, so you might want to investigate this further and possibly asking in a newsgroup
dedicated to the API you are using (ADO, ADO.NET etc).
The bigger problem is how your EXE will output to the screen. Remember that agent is a service (in
"NT") and a service has no Window context...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"J Hunter" <ms-nntp-nospam@.jshunter.co.uk> wrote in message
news:ePdMhboHFHA.236@.TK2MSFTNGP14.phx.gbl...
> Thanks Tibor
> With regard to your comments on creating my own EXE, how would I go about
> getting access to the messages - given that they are not returned as part of
> a result set?
> Cheers
> J.
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:OU%23Lr5lHFHA.4060@.TK2MSFTNGP14.phx.gbl...
> the sub-component in Agent
> information "as it goes".
> this), so I think that
> EXE file that you wrote
> you want it to go.
> BACKUP
> as
> the
> have
> "tail"
>
sql
Sunday, February 26, 2012
Farms
So, what is a farm? Is it better than a cluster? Where can I find information on creating a SQL Server farm?
Many thanks!? I haven't heard the term "farm" used too much in conjunction with SQL Server installations. But there is some info in this doc (found via Google): http://www.dell.com/downloads/global/power/4q03-mis.pdf ... looks like a pretty good article, either way. -- Adam MachanicPro SQL Server 2005, available nowhttp://www..apress.com/book/bookDisplay.html?bID=457-- <Laurence Hunter@.discussions.microsoft.com> wrote in message news:44b215d6-a25e-44ac-83d8-c18517f64798@.discussions.microsoft.com...I'm new to the architect world and I'm trying to solve a performance problem with a SQL Server cluster. But, in talking to some folks they were recommending that I write a design based on a SQL Server "farm". However, when I ask them for more information about what a "farm" is, they start to shuffle their feat!So, what is a farm? Is it better than a cluster? Where can I find information on creating a SQL Server farm?Many thanks!