Showing posts with label version. Show all posts
Showing posts with label version. Show all posts

Friday, March 23, 2012

Little puzzle on data selection

I have the following data (very simplified version)

TransactionId Agent_Code
---- ----
191462 95328C
205427 000024C
205427 75547C

Agent Code 75547C is a corporate agent. The others are not. I have a
list of corporate codes so I can query against it, BUT what I want to
do is...

Return a unique TransactionId and max of the AgentCode, but if the
Agent is a corporate agent, I need to return max of the corporate agent
codes. We can have multiple agents against the transaction and
sometimes have a mix of corporate and none corporate agents. What we
need to do is see the corporate adviser if there is one. I only want 1
record per TransactionId.

We derive more data (sales hierarchy) from this, so are not interested
in anything other than the maximum, but need to know if it was
corporate which therefore gives me a different hierarchy later.

Ideally I want to do this in a view and not use an SP. I can then use
this in my main view. If I have to resort to an SP, then so be it, but
I would appreciate any helpful comments (or even better, the answer)
Thanks

Ryan"Ryan" <ryanofford@.hotmail.com> wrote in message
news:1101996460.738947.289740@.z14g2000cwz.googlegr oups.com...
> I have the following data (very simplified version)
> TransactionId Agent_Code
> ---- ----
> 191462 95328C
> 205427 000024C
> 205427 75547C
> Agent Code 75547C is a corporate agent. The others are not. I have a
> list of corporate codes so I can query against it, BUT what I want to
> do is...
> Return a unique TransactionId and max of the AgentCode, but if the
> Agent is a corporate agent, I need to return max of the corporate agent
> codes. We can have multiple agents against the transaction and
> sometimes have a mix of corporate and none corporate agents. What we
> need to do is see the corporate adviser if there is one. I only want 1
> record per TransactionId.

I would think something like (Obviously untested):

--No Corp Agent
Select TransactionID, Max(Agent_Code) from Transtable a where NOT
EXIST(select * from TransTable b inner join CorpAgents c on b.Agent_Code =
c.Agent_Code where b.TransactionID = a.TransactionID)

UNION ALL
--Corp Agent
Select TransactionID, Max(Agent_Code) from TransTable a inner join
CorpAgents c on a.Agent_Code = c.Agent_Code

Good Luck

Jim|||[posted and mailed, please reply in news]

Ryan (ryanofford@.hotmail.com) writes:
> Return a unique TransactionId and max of the AgentCode, but if the
> Agent is a corporate agent, I need to return max of the corporate agent
> codes. We can have multiple agents against the transaction and
> sometimes have a mix of corporate and none corporate agents. What we
> need to do is see the corporate adviser if there is one. I only want 1
> record per TransactionId.

SELECT TransactionID, coalesce(maxcorp, maxanyone)
FROM (SELECT t.TransactionID, maxanyone = MAX(t.AgentCode),
maxanyone = MAX(a.AgentCode)
FROM transactions t
LEFT JOIN agents a ON t.AgentCode = a.AgentCode
GROUP BY t.TransactionID)

And as you surely know, had you included CREATE TABLE, INSERT and expected
output, the solution would have been tested. Now it's not.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks ! Will give this a try.

Erland Sommarskog <esquel@.sommarskog.se> wrote in message news:<Xns95B3F3141F310Yazorman@.127.0.0.1>...
> [posted and mailed, please reply in news]
> Ryan (ryanofford@.hotmail.com) writes:
> > Return a unique TransactionId and max of the AgentCode, but if the
> > Agent is a corporate agent, I need to return max of the corporate agent
> > codes. We can have multiple agents against the transaction and
> > sometimes have a mix of corporate and none corporate agents. What we
> > need to do is see the corporate adviser if there is one. I only want 1
> > record per TransactionId.
> SELECT TransactionID, coalesce(maxcorp, maxanyone)
> FROM (SELECT t.TransactionID, maxanyone = MAX(t.AgentCode),
> maxanyone = MAX(a.AgentCode)
> FROM transactions t
> LEFT JOIN agents a ON t.AgentCode = a.AgentCode
> GROUP BY t.TransactionID)
> And as you surely know, had you included CREATE TABLE, INSERT and expected
> output, the solution would have been tested. Now it's not.|||>> Return a unique transaction_id and max of the agent_code, but if
the agent is a corporate agent, I need to return max of the corporate
agent codes. <<

Just for fun, try this version:

CREATE VIEW CorpTrans (transaction_id, agent_code)
AS
SELECT transaction_id,
COALESCE(
MAX(CASE WHEN T1.agent_code IN (SELECT agent_code FROM
CorpAgents)
THEN T1.agent_code ELSE NULL END) -- corp_agent,
MAX(CASE WHEN T1.agent_code NOT IN (SELECT agent_code FROM
CorpAgents)
THEN T1.agent_code ELSE NULL END) -- non_corp_agent
) AS agent_code
FROM Transactions AS T1
GROUP BY Transaction_id;

You could also drop the COALESCE (), if it would be more useful to see
both kinds of agents. id the number of corporate agents is small enugh
to fit into main storage, this might actually be a good way to do it!sql

Litespeed question

Hi,
We are using litespeed(version 4.8) to backup databases on SQL Server
2005(SP2 database) but everytime few databases are left out although drive
has enough free space and also it doesnot generate any error
Script for the same is:
EXEC sp_MSforeachdb 'IF ''?'' NOT IN (''tempdb'')
exec master.dbo.xp_backup_database
@.database = ''?'',
@.filename = ''Backupdrivepath\FULL_?.BKP'',
@.backupname = ''FULL ? backup'',
@.desc = ''FULL Backup of ?'', @.init = 1, @.logging = 0,
@.compressionlevel = 5, @.comment = '''', @.with = ''SKIP'',
@.with = ''STATS = 10'' '
Please help me.
ThanksHi Manu,
If you are backing up to Tape drive or network storage then see if there is
any issue with netowrk connectivity Also look at SQL server logs to determine
all databases have been selected for backup.
"manu" wrote:
> Hi,
> We are using litespeed(version 4.8) to backup databases on SQL Server
> 2005(SP2 database) but everytime few databases are left out although drive
> has enough free space and also it doesnot generate any error
> Script for the same is:
> EXEC sp_MSforeachdb 'IF ''?'' NOT IN (''tempdb'')
> exec master.dbo.xp_backup_database
> @.database = ''?'',
> @.filename = ''Backupdrivepath\FULL_?.BKP'',
> @.backupname = ''FULL ? backup'',
> @.desc = ''FULL Backup of ?'', @.init = 1, @.logging = 0,
> @.compressionlevel = 5, @.comment = '''', @.with = ''SKIP'',
> @.with = ''STATS = 10'' '
>
> Please help me.
> Thanks
>

Lite speed compatible to SQL KATMAI CTP -3

Is there a new version for lite speed we need to use in SQL katmai CTP-3 version.

I installed Litespeed 2005 but i am unable to use "xp_backup_database" stored procedure after intstalling litespeed 2005.

Litespeed is a third-party application. You need to ask the vendor, Imceda.|||

Thanks But Do we have any beta version of SQL Lite Speed which is compatible with the SQL Server Katmai CTP3 version, as the current version which we use for SQL Server 2005 is not working ?

Or any time frame in which this might come up if it hasn’t yet?

|||

Moved to Katmai forum.

|||

As the previous reply stated, you need to ask Quest about that - it's not a Microsoft product so we can't comment on beta versions or timing.

sql

Lite speed compatible to SQL KATMAI CTP -3

Is there a new version for lite speed we need to use in SQL katmai CTP-3 version.

I installed Litespeed 2005 but i am unable to use "xp_backup_database" stored procedure after intstalling litespeed 2005.

Litespeed is a third-party application. You need to ask the vendor, Imceda.|||

Thanks But Do we have any beta version of SQL Lite Speed which is compatible with the SQL Server Katmai CTP3 version, as the current version which we use for SQL Server 2005 is not working ?

Or any time frame in which this might come up if it hasn’t yet?

|||

Moved to Katmai forum.

|||

As the previous reply stated, you need to ask Quest about that - it's not a Microsoft product so we can't comment on beta versions or timing.

Monday, March 19, 2012

list SQL servers in a domain

Hi,
I am searching for a tool that list all SQL-servers in a domain or subnet
(servername, instance, SQL version, SQL Edition, SP level). Does anybody know
such software?
Thanks for your help
TillTake a look at the tools on www.sqlsecurity.com
Linchi
"Till Skidzun" wrote:
> Hi,
> I am searching for a tool that list all SQL-servers in a domain or subnet
> (servername, instance, SQL version, SQL Edition, SP level). Does anybody know
> such software?
> Thanks for your help
> Till

list SQL servers in a domain

Hi,
I am searching for a tool that list all SQL-servers in a domain or subnet
(servername, instance, SQL version, SQL Edition, SP level). Does anybody know
such software?
Thanks for your help
Till
Take a look at the tools on www.sqlsecurity.com
Linchi
"Till Skidzun" wrote:

> Hi,
> I am searching for a tool that list all SQL-servers in a domain or subnet
> (servername, instance, SQL version, SQL Edition, SP level). Does anybody know
> such software?
> Thanks for your help
> Till

list SQL servers in a domain

Hi,
I am searching for a tool that list all SQL-servers in a domain or subnet
(servername, instance, SQL version, SQL Edition, SP level). Does anybody kno
w
such software?
Thanks for your help
TillTake a look at the tools on www.sqlsecurity.com
Linchi
"Till Skidzun" wrote:

> Hi,
> I am searching for a tool that list all SQL-servers in a domain or subnet
> (servername, instance, SQL version, SQL Edition, SP level). Does anybody k
now
> such software?
> Thanks for your help
> Till

Friday, March 9, 2012

List of service packs

Hi All
Does anyone know what the best site is to get a list of
all the service packs, version and their downloads all in
a simple list? As far as I can tell, Microsoft does not
have such a table.
Thanks
J> Does anyone know what the best site is to get a list of
> all the service packs, version and their downloads all in
> a simple list? As far as I can tell, Microsoft does not
> have such a table.
Not true. It has :)
http://support.microsoft.com/default.aspx?scid=fh;EN-US;sp
sincerely,
--
Sebastian K. Zaklada
Skilled Software
http://www.skilledsoftware.com
This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi
Yeah, I know about that one, I meant to say patches/fixes
in addition to service packs in my orginal posting.
Thanks
J|||hi J
check out this site
http://www.sqlsecurity.com/DesktopDefault.aspx?tabid=37
Regards,
Mayur
"J" <anonymous@.discussions.microsoft.com> wrote in message
news:d61701c3ef62$b9810620$a001280a@.phx.gbl...
> Hi All
> Does anyone know what the best site is to get a list of
> all the service packs, version and their downloads all in
> a simple list? As far as I can tell, Microsoft does not
> have such a table.
> Thanks
> J|||> Yeah, I know about that one, I meant to say patches/fixes
> in addition to service packs in my orginal posting.
> Thanks
ALL of them or only for SQL Server?
sincerely,
--
Sebastian K. Zaklada
Skilled Software
http://www.skilledsoftware.com
This posting is provided "AS IS" with no warranties, and confers no rights.

List of service packs

Hi All
Does anyone know what the best site is to get a list of
all the service packs, version and their downloads all in
a simple list? As far as I can tell, Microsoft does not
have such a table.
Thanks
J> Does anyone know what the best site is to get a list of
> all the service packs, version and their downloads all in
> a simple list? As far as I can tell, Microsoft does not
> have such a table.
Not true. It has
http://support.microsoft.com/defaul...cid=fh;EN-US;sp
sincerely,
--
Sebastian K. Zaklada
Skilled Software
http://www.skilledsoftware.com
This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi
Yeah, I know about that one, I meant to say patches/fixes
in addition to service packs in my orginal posting.
Thanks
J|||hi J
check out this site
http://www.sqlsecurity.com/DesktopDefault.aspx?tabid=37
Regards,
Mayur
"J" <anonymous@.discussions.microsoft.com> wrote in message
news:d61701c3ef62$b9810620$a001280a@.phx.gbl...
> Hi All
> Does anyone know what the best site is to get a list of
> all the service packs, version and their downloads all in
> a simple list? As far as I can tell, Microsoft does not
> have such a table.
> Thanks
> J|||> Yeah, I know about that one, I meant to say patches/fixes
> in addition to service packs in my orginal posting.
> Thanks
ALL of them or only for SQL Server?
sincerely,
--
Sebastian K. Zaklada
Skilled Software
http://www.skilledsoftware.com
This posting is provided "AS IS" with no warranties, and confers no rights.

Monday, February 20, 2012

Lisen Port

Hello,
I've an aplication make with Apache TomCat that uses the SQL as a DB motor,
i've installed the MSDE version.
Now the Apache couldn't conect with SQL, i think that the problem is in the
conection port, because i created an ODBC conection (in the server machine)
and it only runs property when i mark the option "detect port automaticly",
when i indicated the 1433 port the conection fails. In the apache
configuration i must put the conection port (pe. MYSERVER:1433), i tried
with the port 1433 but it don't works.
could somebody help me?
thanks
hi Tolo,
Tolo wrote:
> Hello,
> I've an aplication make with Apache TomCat that uses the SQL as a DB
> motor, i've installed the MSDE version.
> Now the Apache couldn't conect with SQL, i think that the problem is
> in the conection port, because i created an ODBC conection (in the
> server machine) and it only runs property when i mark the option
> "detect port automaticly", when i indicated the 1433 port the
> conection fails. In the apache configuration i must put the conection
> port (pe. MYSERVER:1433), i tried with the port 1433 but it don't
> works.
> could somebody help me?
> thanks
if you installed a default instance of MSDE it will listen on TCP/IP 1433
port, where named instances usually use dynamically assigned ports, those
requiring UDP 1434 port to be available for the SQL Server Resolution
Service, which will then report the appropriate network endpoints to use for
the particular SQL Server instance, redirecting the MDAC (requires MDAC 2.6
or above) client connections to the appropriate TCP port
you can however set a fixed port using the Server Network Utility
(svrnetcn.exe) and specifying the preferred port (TCP/IP 1433 in your case)
and thus resolving your problem...
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.10.0 - DbaMgr ver 0.56.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Solved,
Thanks, thanks, thanks :D
best reggards,
Tolo
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> escribi en el mensaje
news:36pe05F52ncdvU1@.individual.net...
> hi Tolo,
> Tolo wrote:
> if you installed a default instance of MSDE it will listen on TCP/IP 1433
> port, where named instances usually use dynamically assigned ports, those
> requiring UDP 1434 port to be available for the SQL Server Resolution
> Service, which will then report the appropriate network endpoints to use
for
> the particular SQL Server instance, redirecting the MDAC (requires MDAC
2.6
> or above) client connections to the appropriate TCP port
> you can however set a fixed port using the Server Network Utility
> (svrnetcn.exe) and specifying the preferred port (TCP/IP 1433 in your
case)
> and thus resolving your problem...
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.10.0 - DbaMgr ver 0.56.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
>