Showing posts with label number. Show all posts
Showing posts with label number. Show all posts

Friday, March 30, 2012

OPENQUERY on AS 2005 produces different results than AS 2000

I have an Analysis Server set up as a linked server I want to pass a query to from SQL. However, the number of columns returned differs. My query is as follows:

With Member Measures.PeerGroup As 'Model2CustomerRiskClass.currentmember.parent.parent.uniquename '

select { Measures.[PeerGroup], Measures.[baseamt], Measures.[Count]} on
columns,
{nonEmptyCrossjoin(Model2CustomerRiskClass.[Id].members ,[RecvPay].[RecvPay].members)}
Dimension PROPERTIES [Id].Name, [RecvPay].[recvpay].Name on rows
from Model2 where ([bookdate].&[2007].&[1].&[1])

Executing this directly against the AS (on both AS 2000 and 2005) produces the same results, five columns. The first two are unnamed, but contain the Id Name and RecvPay Name. The other three are PeerGroup, BaseAmt. and Count.

Now, if I execute this statement from Query Analyzer using Select * from OpenQuery (SQL 2000 and AS 2000), I get the same five columns named as follows:
[Model2CustomerRiskClass].[Name]
[RecvPay].[Name]
[Measures].[PeerGroup]
[Measures].[BaseAmt]
[Measures].[Count]

This is fine as my insert statement accepts five columns in that order. However, here's the same result from the same query in Management Studio (SQL 2005 and AS 2005 both SP2 CTP): The columns are:
[Model2CustomerRiskClass].[RiskClass].[Name]
[Model2CustomerRiskClass].[GroupId].[Name]
[Model2CustomerRiskClass].[Id].[Name]
[RecvPay].[RecvPay].[Name]
[Measures].[PeerGroup]
[Measures].[BaseAmt]
[Measures].[Count]

As you see, there are two extra columns. I do not want RiskClass and GroupId levels to show up. Can I get rid of them somehow? I cannot specify my SQL select by column names since, as you see, some column names are also different between the two. I need a query which returns the same columns in both 2000 and 2005. Is this possible?

Thanks,
Boris Zakharin, MCAD
Metavante Risk and Compliance

Any ideas at all? I am still having this issue and it needs to be resolved.

Thanks

OPENQUERY on AS 2005 produces different results than AS 2000

I have an Analysis Server set up as a linked server I want to pass a query to from SQL. However, the number of columns returned differs. My query is as follows:

With Member Measures.PeerGroup As 'Model2CustomerRiskClass.currentmember.parent.parent.uniquename '

select { Measures.[PeerGroup], Measures.[baseamt], Measures.[Count]} on
columns,
{nonEmptyCrossjoin(Model2CustomerRiskClass.[Id].members ,[RecvPay].[RecvPay].members)}
Dimension PROPERTIES [Id].Name, [RecvPay].[recvpay].Name on rows
from Model2 where ([bookdate].&[2007].&[1].&[1])

Executing this directly against the AS (on both AS 2000 and 2005) produces the same results, five columns. The first two are unnamed, but contain the Id Name and RecvPay Name. The other three are PeerGroup, BaseAmt. and Count.

Now, if I execute this statement from Query Analyzer using Select * from OpenQuery (SQL 2000 and AS 2000), I get the same five columns named as follows:
[Model2CustomerRiskClass].[Name]
[RecvPay].[Name]
[Measures].[PeerGroup]
[Measures].[BaseAmt]
[Measures].[Count]

This is fine as my insert statement accepts five columns in that order. However, here's the same result from the same query in Management Studio (SQL 2005 and AS 2005 both SP2 CTP): The columns are:
[Model2CustomerRiskClass].[RiskClass].[Name]
[Model2CustomerRiskClass].[GroupId].[Name]
[Model2CustomerRiskClass].[Id].[Name]
[RecvPay].[RecvPay].[Name]
[Measures].[PeerGroup]
[Measures].[BaseAmt]
[Measures].[Count]

As you see, there are two extra columns. I do not want RiskClass and GroupId levels to show up. Can I get rid of them somehow? I cannot specify my SQL select by column names since, as you see, some column names are also different between the two. I need a query which returns the same columns in both 2000 and 2005. Is this possible?

Thanks,
Boris Zakharin, MCAD
Metavante Risk and Compliance

Any ideas at all? I am still having this issue and it needs to be resolved.

Thanks

Monday, March 12, 2012

Open Connection

Hello everybody

I would like to know more about the number of possible connection to a sql server

is it by pool ? or there is max for all the database ? all the server ?

how I can get the number of connection open ?

Thx in advance

If you run sp_configure and look for "user connections" it will tell you the max number of connections to the server. If you run sp_who2 you can see total connections at that time, and sp_who2 active gives active connections doing something.

|||

Ok, perfect

thank you very much

Saturday, February 25, 2012

Only counting values that appear more than once

Hi guys
I have a table containing serial numbers, some of which occur more than
once. What I want to do is to only count serial number that only occur
more than once. How would I go about doing this?
Many thanksandystob wrote:
> Hi guys
> I have a table containing serial numbers, some of which occur more than
> once. What I want to do is to only count serial number that only occur
> more than once. How would I go about doing this?
> Many thanks
SELECT
SUM(cnt) AS row_cnt,
COUNT(*) AS serial_number_cnt
FROM
(SELECT COUNT(*) AS cnt
FROM your_table
GROUP BY serial_number
HAVING COUNT(*)>1) T ;
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||If I understand your problem correctly,
select sum(Num) from
(select count(*)
from sometable
group by SerialNumber
having count(*)>1) X(Num)|||This will give you your list of duplicate serial numbers...
select serialnumber
from yourtable
group by serialnumber
having count(*) > 1
You can then use that as a join to do your other query...
select ..
from (
select serialnumber
from yourtable
group by serialnumber
having count(*) > 1 ) as dups
inner join yourtable yt on yt.yourid = dups.yourid
Tony.
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials
"andystob" <sql@.evilscience.co.uk> wrote in message
news:1138793435.757970.264220@.o13g2000cwo.googlegroups.com...
> Hi guys
> I have a table containing serial numbers, some of which occur more than
> once. What I want to do is to only count serial number that only occur
> more than once. How would I go about doing this?
> Many thanks
>|||I've tried that code, and I'm getting the following error
Server: Msg 170, Level 15, State 1, Line 21
Line 21: Incorrect syntax near ')'.|||Ah - forgot to add an alias after the last bracket. All working now.
Thanks very much for your help, chaps.|||Hi
SELECT DATEADD(MONTH,DATEDIFF(MONTH,'19000101',
GETDATE()),'19000101')-1
"andystob" <sql@.evilscience.co.uk> wrote in message
news:1138793435.757970.264220@.o13g2000cwo.googlegroups.com...
> Hi guys
> I have a table containing serial numbers, some of which occur more than
> once. What I want to do is to only count serial number that only occur
> more than once. How would I go about doing this?
> Many thanks
>|||Lol Uri - right answer - wrong thread, you want the one before this one ;)
All the best,
Tony.
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%238oncbyJGHA.2012@.TK2MSFTNGP14.phx.gbl...
> Hi
> SELECT DATEADD(MONTH,DATEDIFF(MONTH,'19000101',
GETDATE()),'19000101')-1
>
>
> "andystob" <sql@.evilscience.co.uk> wrote in message
> news:1138793435.757970.264220@.o13g2000cwo.googlegroups.com...
>|||Yep, you are right, I was still thinking about a table variables get
recompiled in our another thread
I 'm going to take a coffee , it is time to relax :-))))
Have a nice day Tony
"Tony Rogerson" <tonyrogerson@.sqlserverfaq.com> wrote in message
news:eUimJkyJGHA.4068@.TK2MSFTNGP10.phx.gbl...
> Lol Uri - right answer - wrong thread, you want the one before this one ;)
> All the best,
> Tony.
> --
> Tony Rogerson
> SQL Server MVP
> http://sqlserverfaq.com - free video tutorials
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:%238oncbyJGHA.2012@.TK2MSFTNGP14.phx.gbl...
>

Monday, February 20, 2012

Online Connection between Access and SQL Server

Hello,
I am trying to develop a database solution for an organisation in
Indonesia.

This organization has a number of offices and users throughout the
country. They all need to maintain their own data, but I also need to
create a central database, to store all of the data, and share data
between the individual users. The problem is that the internet
connections are not reliable, so a online solution isn't possible. I
am planning to implement stand alone databases in Access, which "sync"
with the central server. This sync could happen automatically (maybe
daily), or could be initiated by the user. This Sync would/could take
place when the internet connection is working.

I am very familiar with Access, but I suspect that I will need to use
SQL Server for the central database. I have not used SQL Server
before, and have a few questions:

Is it possible to host a SQL Server, so that it is "Online"? What do I
need to do for this? Does this need to be hosted by an ISP, or could
it been hosted on a computer in our office? What are the security
considerations?
Is it then possible to connect to this SQL Server from the Access
databases in the various locations to "Sync" the data? If I could run
SQL statements from the stand alone databases which could access the
online SQL Server I could write the code for the Sync procedure. The
bit that I am unsure of is how to connect to the SQL Server?

Could anyone point me in the right direction? Examples? References?
What sort of technology to use?
I know VB and how to write SQL statements, it's just the connectivity
that I am unsure of.

Thanks in advance.

Cheers

Michael"Michael" <michael.howden@.gmail.comwrote in
news:1174631759.545107.227660@.o5g2000hsb.googlegro ups.com:

Quote:

Originally Posted by

Hello,
I am trying to develop a database solution for an organisation in
Indonesia.
>
This organization has a number of offices and users throughout the
country. They all need to maintain their own data, but I also need to
create a central database, to store all of the data, and share data
between the individual users. The problem is that the internet
connections are not reliable, so a online solution isn't possible. I
am planning to implement stand alone databases in Access, which "sync"
with the central server. This sync could happen automatically (maybe
daily), or could be initiated by the user. This Sync would/could take
place when the internet connection is working.
>
I am very familiar with Access, but I suspect that I will need to use
SQL Server for the central database. I have not used SQL Server
before, and have a few questions:
>
Is it possible to host a SQL Server, so that it is "Online"? What do I
need to do for this? Does this need to be hosted by an ISP, or could
it been hosted on a computer in our office? What are the security
considerations?
Is it then possible to connect to this SQL Server from the Access
databases in the various locations to "Sync" the data? If I could run
SQL statements from the stand alone databases which could access the
online SQL Server I could write the code for the Sync procedure. The
bit that I am unsure of is how to connect to the SQL Server?
>
Could anyone point me in the right direction? Examples? References?
What sort of technology to use?
I know VB and how to write SQL statements, it's just the connectivity
that I am unsure of.
>
Thanks in advance.
>
Cheers
>
Michael


Yes.

There are many providers of internet available MS-SQL databases for as
little as 10 USD / month. They provide server maintenance and do daily
backups. They are up 99.44% of the time which is far more than the server
of any organization with which I have worked. I have been very happy with
DiscountAsp.Net, after being less than happy with Interland. (3 times the
service, one third the cost). One can connect to them with a simple cable
or dsl internet connection and do the table, sproc creation etc with any
number of utilities, including Access. Many are free. I use Microsoft SQL
Server Management Studio Express (free). Its interface is much superior
to Access's.

One can then connect and "sync" through Access and (ODBC or ADO). Of
course there are other technologies for doing so; some are feee. If one
is not going to use Access as a User Interface for editing, reporting etc
then it may be entirely wasteful to load in this inefficient collection
of archaic procedures and convoluted code.

MVPs and others here have argued that such internet-enabled databases are
insecure. I have been using them for many years. I have never had a
problem with security. In the autumn I created a new database at
DiscountAsp and challenged the insecurephobiacs to break in and do a
simple task, viz, create a simple table named with their name, eg,
"Albert" or "David". No one has done so yet.

Typically these providers use very sophiticated security software as
below:

""TippingPoint Intrusion Prevention Systems
The TippingPoint Intrusion Prevention System (IPS) delivers the most
powerful network protection in the world. The TippingPoint IPS is an
in-line device that is inserted seamlessly and transparently into the
network. As packets pass through the IPS, they are fully inspected to
determine whether they are legitimate or malicious. This instantaneous
form of protection is the most effective means of preventing attacks
from ever reaching their targets.

TippingPoint's Intrusion Prevention Systems provide Application
Protection, Performance Protection and Infrastructure Protection at
gigabit speeds through total packet inspection. Application Protection
capabilities provide fast, accurate, reliable protection from internal
and external cyber attacks. Through its Infrastructure Protection
capabilities, the TippingPoint IPS protects VoIP infrastructure,
routers, switches, DNS and other critical infrastructure from targeted
attacks and traffic anomalies. TippingPoint's Performance Protection
capabilities enable customers to throttle non-mission critical
applications that hijack valuable bandwidth and IT resources, thereby
aligning network resources and business-critical application
performance.

The system is built upon TippingPoint's Threat Suppression Engine (TSE)
- a highly specialized hardware-based intrusion prevention platform
consisting of state-of-the-art network processor technology and
TippingPoint's own set of custom ASICs. The TippingPoint ASIC-based
Threat Suppression Engine is the underlying technology that has
revolutionized network protection. Through a combination of pipelined
and massively parallel processing hardware, the TSE is able to perform
thousands of checks on each packet flow simultaneously. The TSE
architecture utilizes custom ASICs, a 20 Gbps backplane and
high-performance network processors to perform total packet flow
inspection at Layers 2-7. Parallel processing ensures that packet flows
continue to move through the IPS with a latency of less than 215
microseconds, independent of the number of filters that are applied.

The TippingPoint TSE architecture also enables traffic classification
and rate shaping. Sophisticated algorithms baseline "normal" traffic
allowing for automatic thresholds and throttling so that mission
critical applications are given a higher priority on the network.

The TippingPoint IPS family offers a range of products that differ in
capacity and the number of simultaneous segments they protect.

TippingPoint X505
TippingPoint 50
TippingPoint 200
TippingPoint 200E
TippingPoint 400
TippingPoint 1200E
TippingPoint 2400E
TippingPoint 5000E
TippingPoint SMS (Enterprise-Level Management System)
TippingPoint ZPHA (Zero Power High Availability)
An integral part of the TippingPoint solution is the Digital Vaccine
Service that delivers new filters on a weekly or even daily basis to
maintain evergreen protection for the latest vulnerabilities, exploits,
viruses and rogue applications."

--
lyle fairfield

Ceterum censeo Redmond esse delendam.