Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
cdula
Starting Member
4 Posts |
Posted - 2013-07-16 : 13:19:49
|
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
52326 Posts |
Posted - 2013-07-16 : 13:31:19
|
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 =,! etcSo check the logic used and see if it returns duplicates. In case it returns rewrite it to avoid duplicate values------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
 |
|
cdula
Starting Member
4 Posts |
Posted - 2013-07-16 : 13:38:58
|
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 =,! etcSo check the logic used and see if it returns duplicates. In case it returns rewrite it to avoid duplicate values------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs
|
 |
|
cdula
Starting Member
4 Posts |
Posted - 2013-07-16 : 13:50:10
|
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 =,! etcSo check the logic used and see if it returns duplicates. In case it returns rewrite it to avoid duplicate values------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs
|
 |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-07-16 : 15:40:44
|
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. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-07-17 : 01:16:46
|
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 =,! etcSo check the logic used and see if it returns duplicates. In case it returns rewrite it to avoid duplicate values------------------------------------------------------------------------------------------------------SQL Server MVPhttp://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 MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
 |
|
cdula
Starting Member
4 Posts |
Posted - 2013-07-17 : 16:49:51
|
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.
|
 |
|
|
|
|
|
|