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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:03:05+00:00 2026-05-24T06:03:05+00:00

I have a table (result of a stored procedure from someone else), and it

  • 0

I have a table (result of a stored procedure from someone else), and it retuns a table ##tableT in the form

1      2    3    4    5     6
----------------------------------------------
467    116  480  477  491   697
NULL   19   481  113  488   466
123    4354 477  466  55    480
NULL   NULL NULL 527  83    629
45     34   NULL  5   483   483

As you can see it has NULLS, and most important the name of the columns are numbers, so when I do

SELECT coalesce(1, -1) as att1, coalesce(2, -1) as att2,....,coalesce(6, -1) as att6 FROM [dbm].[dbo].[##tableT];

I get:

1   2   3   4   5   6
1   2   3   4   5   6
1   2   3   4   5   6
1   2   3   4   5   6
1   2   3   4   5   6

Instead of:

1      2    3    4    5     6
----------------------------------------------
467    116  480  477  491   697
-1     19   481  113  488   466
123    4354 477  466  55    480
-1     -1   -1   527  83    629
45     34   -1   5   483    483
  • 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-24T06:03:07+00:00Added an answer on May 24, 2026 at 6:03 am

    try

    SELECT ISNULL([1], -1) as att1, ISNULL([2], -1) as att2,....,ISNULL([6], -1) as att6 FROM [dbm].[dbo].[##tableT];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a stored procedure that writes results to a Result table. How do
Let's say we have a stored procedure selecting something from a table: CREATE PROCEDURE
I have a stored procedure that needs to pass a result set from another
I have the following table >anna2 name from to result 11 66607 66841 5
I have a stored procedure which returns a Dataset(Table) . How can I use
I have a stored procedure that uses a table valued function which executes in
I've an existing stored procedure SP1 which is simple select from a table. It's
I have a report that renders data returned from a stored procedure. Using profiler
I have a MySQL stored procedure that is executed from Python (wrapped in Django).
I have a table 'results' in which the scores are stored. Its ordered by

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.