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

  • Home
  • SEARCH
  • 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 6660713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:11:22+00:00 2026-05-26T02:11:22+00:00

i have a issue on sql server 2008, i have 2 tables SlideShow and

  • 0

i have a issue on sql server 2008, i have 2 tables SlideShow and Slide. common field in both the table is SlideShowId.
now to get all the SlideShow with SlideCount i use this procedure.

ALTER PROCEDURE [dbo].[sp_GetAllSlideShow]
    @FILTER BIT,
    @PORTALID INT
AS
BEGIN
    IF (@FILTER = 1)
        SELECT SS.SLIDESHOWNAME + ' [' + CAST((COUNT(S.SLIDEID)) AS VARCHAR(MAX))+']', SS.SLIDESHOWID FROM SLIDESHOW SS
        INNER JOIN SLIDES S
        ON SS.SLIDESHOWID = S.SLIDESHOWID
        WHERE SS.PORTALID = 0 AND [TYPE] IS NULL
        GROUP BY SS.SLIDESHOWNAME, SS.SLIDESHOWID
    ELSE
        SELECT SS.SLIDESHOWNAME + ' [' + CAST((COUNT(S.SLIDEID)) AS VARCHAR(MAX))+']', SS.SLIDESHOWID FROM SLIDESHOW SS
        INNER JOIN SLIDES S
        ON SS.SLIDESHOWID = S.SLIDESHOWID
        WHERE SS.PORTALID = @PORTALID
        GROUP BY SS.SLIDESHOWNAME, SS.SLIDESHOWID
END

this runs fine, but say if new slideshow has been created, this procedure does not show up that slideshow until new slide has been created in that slideshow, actually that is because i have joined both the tables for SlideCount, and there is no slide for particular slideshow, that slideshow wont show up, but i also want that slideshow. the count in that should be 0 by default.

is there any way i can do that.

  • 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-05-26T02:11:22+00:00Added an answer on May 26, 2026 at 2:11 am

    That is because you are using an INNER JOIN. An INNER JOIN will only show results that are equal in both tables, so if your slideshow record was added to only one table then the INNER JOIN would not pull it in the SELECT. Try changing your INNER JOIN to a LEFT JOIN.

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

Sidebar

Related Questions

I have a table with a VARBINARY(MAX) field (SQL Server 2008 with FILESTREAM )
I have created a set of tables (around 20) in SQL Server 2008 and
I have a SQL Server 2008 database table that uses uniqueidentifier as a primary
I'm working with a db (SQL server 2008), and have an interesting issue with
I have a view defined in SQL server 2008 that joins 4 tables together.
I have a SQL Server 2008 R2 database table with 12k address records where
Edit: Im running SQL Server 2008 I have about 400,000 rows in my table.
I'm experiencing something a bit strange. I have a table on SQL Server 2008,
I am using SQL Server 2008 and I have this issue. I have a
Tables have been created in our SQL Server 2008 R2 database on a local server,

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.