dbTalk Databases Forums  

Failing DTS 'Subquery returned more than 1 value. This is not permitted when the

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Failing DTS 'Subquery returned more than 1 value. This is not permitted when the in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jay via SQLMonster.com
 
Posts: n/a

Default Failing DTS 'Subquery returned more than 1 value. This is not permitted when the - 02-27-2008 , 10:06 AM






I received the following message from a DTS package that fails. 'Subquery
returned more than 1 value. This is not permitted when the subquery follows =,
!=, <, <=, >,>= or when the subquery is used as an expression'. It occurs
during an update with the following statement:

'UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT Provider.Provider_Key FROM dbo.Provider WHERE
Provider.Datasource_ID = FEIProviderStatus.DatasourceID AND Provider.
Provider_key <> 8602)

UPDATE dbo.FEIProviderStatus
SET PayorKey = (SELECT Payor.Payor_Key FROM dbo.Payor WHERE Payor.
Datasource_ID = FEIProviderStatus.DatasourceID)'

Thanks in advance.

Jay

--
Message posted via http://www.sqlmonster.com


Reply With Quote
  #2  
Old   
Russell Fields
 
Posts: n/a

Default Re: Failing DTS 'Subquery returned more than 1 value. This is not permitted when the - 02-27-2008 , 10:19 AM






Jay,

It is telling you that your subselects are getting more than 1 row back.
So, a couple of possibilities are:

1. The join and filter on the subselect are not as specific as they should
be. That may mean investigating the data to determine what is being
overlooked.

2. Yes, multiple rows are being returned in some instances, but it does not
matter to you since you just want a single Provider_Key. (Perhaps you even
know that the multiple Provider_Key values are identical.) In that case,
use an aggregate to enforce returning a single row. For example:

UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT MAX(Provider.Provider_Key) -- MAX enforces a
single value
FROM dbo.Provider
WHERE Provider.Datasource_ID = FEIProviderStatus.DatasourceID
AND Provider.Provider_key <> 8602)

RLF

"Jay via SQLMonster.com" <u7124@uwe> wrote

Quote:
I received the following message from a DTS package that fails. 'Subquery
returned more than 1 value. This is not permitted when the subquery
follows =,
!=, <, <=, >,>= or when the subquery is used as an expression'. It occurs
during an update with the following statement:

'UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT Provider.Provider_Key FROM dbo.Provider WHERE
Provider.Datasource_ID = FEIProviderStatus.DatasourceID AND Provider.
Provider_key <> 8602)

UPDATE dbo.FEIProviderStatus
SET PayorKey = (SELECT Payor.Payor_Key FROM dbo.Payor WHERE Payor.
Datasource_ID = FEIProviderStatus.DatasourceID)'

Thanks in advance.

Jay

--
Message posted via http://www.sqlmonster.com




Reply With Quote
  #3  
Old   
Russell Fields
 
Posts: n/a

Default Re: Failing DTS 'Subquery returned more than 1 value. This is not permitted when the - 02-27-2008 , 10:19 AM



Jay,

It is telling you that your subselects are getting more than 1 row back.
So, a couple of possibilities are:

1. The join and filter on the subselect are not as specific as they should
be. That may mean investigating the data to determine what is being
overlooked.

2. Yes, multiple rows are being returned in some instances, but it does not
matter to you since you just want a single Provider_Key. (Perhaps you even
know that the multiple Provider_Key values are identical.) In that case,
use an aggregate to enforce returning a single row. For example:

UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT MAX(Provider.Provider_Key) -- MAX enforces a
single value
FROM dbo.Provider
WHERE Provider.Datasource_ID = FEIProviderStatus.DatasourceID
AND Provider.Provider_key <> 8602)

RLF

"Jay via SQLMonster.com" <u7124@uwe> wrote

Quote:
I received the following message from a DTS package that fails. 'Subquery
returned more than 1 value. This is not permitted when the subquery
follows =,
!=, <, <=, >,>= or when the subquery is used as an expression'. It occurs
during an update with the following statement:

'UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT Provider.Provider_Key FROM dbo.Provider WHERE
Provider.Datasource_ID = FEIProviderStatus.DatasourceID AND Provider.
Provider_key <> 8602)

UPDATE dbo.FEIProviderStatus
SET PayorKey = (SELECT Payor.Payor_Key FROM dbo.Payor WHERE Payor.
Datasource_ID = FEIProviderStatus.DatasourceID)'

Thanks in advance.

Jay

--
Message posted via http://www.sqlmonster.com




Reply With Quote
  #4  
Old   
Russell Fields
 
Posts: n/a

Default Re: Failing DTS 'Subquery returned more than 1 value. This is not permitted when the - 02-27-2008 , 10:19 AM



Jay,

It is telling you that your subselects are getting more than 1 row back.
So, a couple of possibilities are:

1. The join and filter on the subselect are not as specific as they should
be. That may mean investigating the data to determine what is being
overlooked.

2. Yes, multiple rows are being returned in some instances, but it does not
matter to you since you just want a single Provider_Key. (Perhaps you even
know that the multiple Provider_Key values are identical.) In that case,
use an aggregate to enforce returning a single row. For example:

UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT MAX(Provider.Provider_Key) -- MAX enforces a
single value
FROM dbo.Provider
WHERE Provider.Datasource_ID = FEIProviderStatus.DatasourceID
AND Provider.Provider_key <> 8602)

RLF

"Jay via SQLMonster.com" <u7124@uwe> wrote

Quote:
I received the following message from a DTS package that fails. 'Subquery
returned more than 1 value. This is not permitted when the subquery
follows =,
!=, <, <=, >,>= or when the subquery is used as an expression'. It occurs
during an update with the following statement:

'UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT Provider.Provider_Key FROM dbo.Provider WHERE
Provider.Datasource_ID = FEIProviderStatus.DatasourceID AND Provider.
Provider_key <> 8602)

UPDATE dbo.FEIProviderStatus
SET PayorKey = (SELECT Payor.Payor_Key FROM dbo.Payor WHERE Payor.
Datasource_ID = FEIProviderStatus.DatasourceID)'

Thanks in advance.

Jay

--
Message posted via http://www.sqlmonster.com




Reply With Quote
  #5  
Old   
Russell Fields
 
Posts: n/a

Default Re: Failing DTS 'Subquery returned more than 1 value. This is not permitted when the - 02-27-2008 , 10:19 AM



Jay,

It is telling you that your subselects are getting more than 1 row back.
So, a couple of possibilities are:

1. The join and filter on the subselect are not as specific as they should
be. That may mean investigating the data to determine what is being
overlooked.

2. Yes, multiple rows are being returned in some instances, but it does not
matter to you since you just want a single Provider_Key. (Perhaps you even
know that the multiple Provider_Key values are identical.) In that case,
use an aggregate to enforce returning a single row. For example:

UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT MAX(Provider.Provider_Key) -- MAX enforces a
single value
FROM dbo.Provider
WHERE Provider.Datasource_ID = FEIProviderStatus.DatasourceID
AND Provider.Provider_key <> 8602)

RLF

"Jay via SQLMonster.com" <u7124@uwe> wrote

Quote:
I received the following message from a DTS package that fails. 'Subquery
returned more than 1 value. This is not permitted when the subquery
follows =,
!=, <, <=, >,>= or when the subquery is used as an expression'. It occurs
during an update with the following statement:

'UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT Provider.Provider_Key FROM dbo.Provider WHERE
Provider.Datasource_ID = FEIProviderStatus.DatasourceID AND Provider.
Provider_key <> 8602)

UPDATE dbo.FEIProviderStatus
SET PayorKey = (SELECT Payor.Payor_Key FROM dbo.Payor WHERE Payor.
Datasource_ID = FEIProviderStatus.DatasourceID)'

Thanks in advance.

Jay

--
Message posted via http://www.sqlmonster.com




Reply With Quote
  #6  
Old   
Russell Fields
 
Posts: n/a

Default Re: Failing DTS 'Subquery returned more than 1 value. This is not permitted when the - 02-27-2008 , 10:19 AM



Jay,

It is telling you that your subselects are getting more than 1 row back.
So, a couple of possibilities are:

1. The join and filter on the subselect are not as specific as they should
be. That may mean investigating the data to determine what is being
overlooked.

2. Yes, multiple rows are being returned in some instances, but it does not
matter to you since you just want a single Provider_Key. (Perhaps you even
know that the multiple Provider_Key values are identical.) In that case,
use an aggregate to enforce returning a single row. For example:

UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT MAX(Provider.Provider_Key) -- MAX enforces a
single value
FROM dbo.Provider
WHERE Provider.Datasource_ID = FEIProviderStatus.DatasourceID
AND Provider.Provider_key <> 8602)

RLF

"Jay via SQLMonster.com" <u7124@uwe> wrote

Quote:
I received the following message from a DTS package that fails. 'Subquery
returned more than 1 value. This is not permitted when the subquery
follows =,
!=, <, <=, >,>= or when the subquery is used as an expression'. It occurs
during an update with the following statement:

'UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT Provider.Provider_Key FROM dbo.Provider WHERE
Provider.Datasource_ID = FEIProviderStatus.DatasourceID AND Provider.
Provider_key <> 8602)

UPDATE dbo.FEIProviderStatus
SET PayorKey = (SELECT Payor.Payor_Key FROM dbo.Payor WHERE Payor.
Datasource_ID = FEIProviderStatus.DatasourceID)'

Thanks in advance.

Jay

--
Message posted via http://www.sqlmonster.com




Reply With Quote
  #7  
Old   
Russell Fields
 
Posts: n/a

Default Re: Failing DTS 'Subquery returned more than 1 value. This is not permitted when the - 02-27-2008 , 10:19 AM



Jay,

It is telling you that your subselects are getting more than 1 row back.
So, a couple of possibilities are:

1. The join and filter on the subselect are not as specific as they should
be. That may mean investigating the data to determine what is being
overlooked.

2. Yes, multiple rows are being returned in some instances, but it does not
matter to you since you just want a single Provider_Key. (Perhaps you even
know that the multiple Provider_Key values are identical.) In that case,
use an aggregate to enforce returning a single row. For example:

UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT MAX(Provider.Provider_Key) -- MAX enforces a
single value
FROM dbo.Provider
WHERE Provider.Datasource_ID = FEIProviderStatus.DatasourceID
AND Provider.Provider_key <> 8602)

RLF

"Jay via SQLMonster.com" <u7124@uwe> wrote

Quote:
I received the following message from a DTS package that fails. 'Subquery
returned more than 1 value. This is not permitted when the subquery
follows =,
!=, <, <=, >,>= or when the subquery is used as an expression'. It occurs
during an update with the following statement:

'UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT Provider.Provider_Key FROM dbo.Provider WHERE
Provider.Datasource_ID = FEIProviderStatus.DatasourceID AND Provider.
Provider_key <> 8602)

UPDATE dbo.FEIProviderStatus
SET PayorKey = (SELECT Payor.Payor_Key FROM dbo.Payor WHERE Payor.
Datasource_ID = FEIProviderStatus.DatasourceID)'

Thanks in advance.

Jay

--
Message posted via http://www.sqlmonster.com




Reply With Quote
  #8  
Old   
Russell Fields
 
Posts: n/a

Default Re: Failing DTS 'Subquery returned more than 1 value. This is not permitted when the - 02-27-2008 , 10:19 AM



Jay,

It is telling you that your subselects are getting more than 1 row back.
So, a couple of possibilities are:

1. The join and filter on the subselect are not as specific as they should
be. That may mean investigating the data to determine what is being
overlooked.

2. Yes, multiple rows are being returned in some instances, but it does not
matter to you since you just want a single Provider_Key. (Perhaps you even
know that the multiple Provider_Key values are identical.) In that case,
use an aggregate to enforce returning a single row. For example:

UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT MAX(Provider.Provider_Key) -- MAX enforces a
single value
FROM dbo.Provider
WHERE Provider.Datasource_ID = FEIProviderStatus.DatasourceID
AND Provider.Provider_key <> 8602)

RLF

"Jay via SQLMonster.com" <u7124@uwe> wrote

Quote:
I received the following message from a DTS package that fails. 'Subquery
returned more than 1 value. This is not permitted when the subquery
follows =,
!=, <, <=, >,>= or when the subquery is used as an expression'. It occurs
during an update with the following statement:

'UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT Provider.Provider_Key FROM dbo.Provider WHERE
Provider.Datasource_ID = FEIProviderStatus.DatasourceID AND Provider.
Provider_key <> 8602)

UPDATE dbo.FEIProviderStatus
SET PayorKey = (SELECT Payor.Payor_Key FROM dbo.Payor WHERE Payor.
Datasource_ID = FEIProviderStatus.DatasourceID)'

Thanks in advance.

Jay

--
Message posted via http://www.sqlmonster.com




Reply With Quote
  #9  
Old   
Russell Fields
 
Posts: n/a

Default Re: Failing DTS 'Subquery returned more than 1 value. This is not permitted when the - 02-27-2008 , 10:19 AM



Jay,

It is telling you that your subselects are getting more than 1 row back.
So, a couple of possibilities are:

1. The join and filter on the subselect are not as specific as they should
be. That may mean investigating the data to determine what is being
overlooked.

2. Yes, multiple rows are being returned in some instances, but it does not
matter to you since you just want a single Provider_Key. (Perhaps you even
know that the multiple Provider_Key values are identical.) In that case,
use an aggregate to enforce returning a single row. For example:

UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT MAX(Provider.Provider_Key) -- MAX enforces a
single value
FROM dbo.Provider
WHERE Provider.Datasource_ID = FEIProviderStatus.DatasourceID
AND Provider.Provider_key <> 8602)

RLF

"Jay via SQLMonster.com" <u7124@uwe> wrote

Quote:
I received the following message from a DTS package that fails. 'Subquery
returned more than 1 value. This is not permitted when the subquery
follows =,
!=, <, <=, >,>= or when the subquery is used as an expression'. It occurs
during an update with the following statement:

'UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT Provider.Provider_Key FROM dbo.Provider WHERE
Provider.Datasource_ID = FEIProviderStatus.DatasourceID AND Provider.
Provider_key <> 8602)

UPDATE dbo.FEIProviderStatus
SET PayorKey = (SELECT Payor.Payor_Key FROM dbo.Payor WHERE Payor.
Datasource_ID = FEIProviderStatus.DatasourceID)'

Thanks in advance.

Jay

--
Message posted via http://www.sqlmonster.com




Reply With Quote
  #10  
Old   
Jay via SQLMonster.com
 
Posts: n/a

Default Re: Failing DTS 'Subquery returned more than 1 value. This is not permitted when the - 02-27-2008 , 10:28 AM



Russell, thanks much for this help. It worked.

Jay,

Russell Fields wrote:
Quote:
Jay,

It is telling you that your subselects are getting more than 1 row back.
So, a couple of possibilities are:

1. The join and filter on the subselect are not as specific as they should
be. That may mean investigating the data to determine what is being
overlooked.

2. Yes, multiple rows are being returned in some instances, but it does not
matter to you since you just want a single Provider_Key. (Perhaps you even
know that the multiple Provider_Key values are identical.) In that case,
use an aggregate to enforce returning a single row. For example:

UPDATE dbo.FEIProviderStatus
SET ProviderKey = (SELECT MAX(Provider.Provider_Key) -- MAX enforces a
single value
FROM dbo.Provider
WHERE Provider.Datasource_ID = FEIProviderStatus.DatasourceID
AND Provider.Provider_key <> 8602)

RLF

I received the following message from a DTS package that fails. 'Subquery
returned more than 1 value. This is not permitted when the subquery
[quoted text clipped - 14 lines]

Jay
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums...r-dts/200802/1



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.