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 4248478
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:15:44+00:00 2026-05-21T04:15:44+00:00

Iam asking this because iam very much new to stored procedure. Can any help

  • 0

Iam asking this because iam very much new to stored procedure. Can any help me in writing a stored procedure for checking whether value of a columns of a table are populated or not by using a stored procedure?

for example:- I have a table named student. it contains 5 columns.in this almost 3 columns have values and other two columns do not have values in it. So by stored procedure how can we do this?

  • 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-21T04:15:44+00:00Added an answer on May 21, 2026 at 4:15 am

    You can use this to get the column names that does not have any values.

    declare @T table (Col1 int, Col2 int, Col3 int, Col4 int, Col5 int)
    
    insert into @T values (1,    1,    1,    null, null)
    insert into @T values (2,    2,    null, null, null)
    insert into @T values (3,    null, null, null, null)
    insert into @T values (null, null, null, null, null)
    
    select [Column]
    from 
      (select
         count(Col1) as Col1,
         count(Col2) as Col2,
         count(Col3) as Col3,
         count(Col4) as Col4,
         count(Col5) as Col5
       from @T) as T
    unpivot
       ([Count] for [Column] in 
          (Col1, Col2, Col3, Col4, Col5)
    ) as unpvt
    where [Count] = 0
    

    Result

    Column
    ------
    Col4
    Col5
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Very new, so let me know if this is asking too much. I am
I am asking here because I haven't gotten any help from the OpenCV developers
Does Spongy Castle Provide the implementation of SHA1PRNG Algorithm? I am asking this because
I am asking this question here because it is my understanding that this is
I am not sure whether I am asking this with the right words, I
I searched SO before asking this question, I am completely new to this and
I am asking for help, after hours of trying to figure this out myself.
This question is very much related to: A) How to separate CUDA code into
The reason I am asking this question is because I have landed my first
I am 80% sure I should not be asking this question because it might

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.