SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Sql error message
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cdula
Starting Member

Mozambique
4 Posts

Posted - 07/16/2013 :  13:19:49  Show Profile  Reply with Quote
Hi there,

I am trying to sync a file using sync monitor when I import the file a error message show that can't import, see below:

could not import the table _?????????. subquery returned more than 1 value. This is not permitted when the subquery follows =,!

Please can you explain to me how can i solve this?

Thanks

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 07/16/2013 :  13:31:19  Show Profile  Reply with Quote
the issue seems to be usage of a subquery based logic. As error suggests subquery returning multiple values is not permitted when used with operators like =,! etc
So check the logic used and see if it returns duplicates. In case it returns rewrite it to avoid duplicate values

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

cdula
Starting Member

Mozambique
4 Posts

Posted - 07/16/2013 :  13:38:58  Show Profile  Reply with Quote
thank you.


quote:
Originally posted by visakh16

the issue seems to be usage of a subquery based logic. As error suggests subquery returning multiple values is not permitted when used with operators like =,! etc
So check the logic used and see if it returns duplicates. In case it returns rewrite it to avoid duplicate values

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs


Go to Top of Page

cdula
Starting Member

Mozambique
4 Posts

Posted - 07/16/2013 :  13:50:10  Show Profile  Reply with Quote
Let me explain cause is rushing me.

We have branch db and HO db the end of the day export via ftp files to be import in HO some of the files in middle didn't import successful on certain day (yesterday) but today was import successfull.

Maybe was cause by bad capture or ftp corrupt the file?

can you please help on this as I told am new in Sql and can't find the logic.


quote:
Originally posted by visakh16

the issue seems to be usage of a subquery based logic. As error suggests subquery returning multiple values is not permitted when used with operators like =,! etc
So check the logic used and see if it returns duplicates. In case it returns rewrite it to avoid duplicate values

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs


Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3744 Posts

Posted - 07/16/2013 :  15:40:44  Show Profile  Reply with Quote
I wouldn't call it corrupt file. It it works sometimes, and doens't work at other times, one possiblity is that there is unexpected data in the file. Think of a case where your file should have only one row per client id, but for some reason it ends up having more than one on a given day. The person who wrote the logic to import the data may not have considered the case where there is such duplicate data.

So one way to go at it is to examine the source file to see if you can identify any inconsistencies such as those.

If that doesn't help you will need to locate the code that is doing the importing. What tool are you using for importing? There is some T-SQL code that the tool invokes, and that is where the error is coming from. If you can get at that code, then that should take you half-way to identifying the problem.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 07/17/2013 :  01:16:46  Show Profile  Reply with Quote
quote:
Originally posted by cdula

Let me explain cause is rushing me.

We have branch db and HO db the end of the day export via ftp files to be import in HO some of the files in middle didn't import successful on certain day (yesterday) but today was import successfull.

Maybe was cause by bad capture or ftp corrupt the file?

can you please help on this as I told am new in Sql and can't find the logic.


quote:
Originally posted by visakh16

the issue seems to be usage of a subquery based logic. As error suggests subquery returning multiple values is not permitted when used with operators like =,! etc
So check the logic used and see if it returns duplicates. In case it returns rewrite it to avoid duplicate values

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs





Your post doesnt have enough details for someone to understand why file import was unsuccessful. Did you check the job history/log? Can you post error messages?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

cdula
Starting Member

Mozambique
4 Posts

Posted - 07/17/2013 :  16:49:51  Show Profile  Reply with Quote
The tool is calling: Database Synchronisation Monitor. I get the logic but if I can query the info on file will be easy for me to solve cause I can delete _etblDeleted table which cause the issue.



quote:
Originally posted by James K

I wouldn't call it corrupt file. It it works sometimes, and doens't work at other times, one possiblity is that there is unexpected data in the file. Think of a case where your file should have only one row per client id, but for some reason it ends up having more than one on a given day. The person who wrote the logic to import the data may not have considered the case where there is such duplicate data.

So one way to go at it is to examine the source file to see if you can identify any inconsistencies such as those.

If that doesn't help you will need to locate the code that is doing the importing. What tool are you using for importing? There is some T-SQL code that the tool invokes, and that is where the error is coming from. If you can get at that code, then that should take you half-way to identifying the problem.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000