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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:57:45+00:00 2026-05-22T12:57:45+00:00

I have got a sql table view where one of the columns is calculated:

  • 0

I have got a sql table view where one of the columns is calculated: 0.1 * [column_name] where [column_name] is of type Decimal not NULL.

Received view field becomes Decimal NULL because of some reason.

Why NOT NULL changes to NULL?

Regards
Mariusz

  • 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-22T12:57:45+00:00Added an answer on May 22, 2026 at 12:57 pm

    You can force it back to being not null by wrapping it in an ISNULL:

    create table T (
        Value decimal(38,12) not null
    )
    go
    create view V1
    as
        select 0.1 * Value as Value from T
    go
    create view V2
    as
        select ISNULL(0.1 * Value,0) as Value from T
    go
    

    V1’s value column is marked as nullable, V2’s isn’t. Strangely, this is one place where you can’t use the more standards compliant COALESCE:

    create view V3
    as
        select COALESCE(0.1 * Value,0) as Value from T
    go
    

    V3 resembles V1.

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

Sidebar

Related Questions

I have got a task table in my database with a priority field containing
I've got a SQL Database Table, which has 35 existing records. One of the
We have got 221gb table in our SQL Database, mainly duplicate data. Team has
I have got SQL Server database in which Table column name have spaces. For
I have a SQL Table with the following columns: PROFILE ---------------------------------- Name | DateOfBirth
i've got a SQL query which returns multiple rows, and i have : $data
I've got two PostgreSQL databases that have been created using the same sql file.
I have one specific view created in my DB(joins about 5-6 tables with a
I need to create a view or a table valued function that returns one
I've got a question about reusing table data but a view won't work in

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.