Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8899215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:48:26+00:00 2026-06-15T00:48:26+00:00

I am trying to achieve something of this sort in SSIS OLEDB Source. 1)

  • 0

I am trying to achieve something of this sort in SSIS OLEDB Source.

1) Count the records in the exception table
2) If there are exceptions, write the data to excel sheet
3) If not, write ‘No data available’

I wrote a simple query for doing this, but get the error
Msg 116, Level 16, State 1, Line 3
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

SELECT CASE WHEN (SELECT COUNT(*) FROM exceptionTable) > 0 THEN
(SELECT * FROM exceptionTable) ELSE 'No Error data available' end

I understand what the error message says and know how to solve it, but I cant think of an alternative solution to this problem. Any help will be appreciated. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:48:28+00:00Added an answer on June 15, 2026 at 12:48 am

    You should be able to handle this using the EXISTS keyword. Something along these lines should do the trick:

    if exists(select * from exceptionTable)
        select * from exceptionTable
    else 
        select 'No Error data available'
    

    The EXISTS keyword specifies a subquery that can be used to test for the existence of any rows that are returned by the subquery. If no rows are returned, it evaluates to false and the ELSE clause is executed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to achieve something like this in LaTeX: http://sorenhaagerup.dk/files/table-sample.pdf (sample made in OpenOffice.org)
I am trying to achieve something like this. The Expandable List consists of the
I am currently trying to achieve something like this: Based on this class, I
I am trying to achieve exactly something like this - a text view on
What I am trying to achieve is something like this: class object: def __init__(self):
I'm trying to achieve something similar to jQuery Glow or this fiddle . Specifically
I'm trying to achieve something like this: def a(b: Any) = { b match
I'm trying to achieve something like this: <f:detailview item=#{bean.getOne()} var=p> <h:outputText value=#{p.name} /> </f:detailview>
I'm using SQL Server 2005 and I'm trying to achieve something like this: I
I am trying to achieve something like this: while (ifstream has not been entirely

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.