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

The Archive Base Latest Questions

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

I am getting one error when I try to make my field IsPersisted=True This

  • 0

I am getting one error when I try to make my field IsPersisted=True

This is the definition of my table

CREATE TABLE [dbo].[AdvanceMST](
[AdvanceID] [bigint] IDENTITY(1,1) NOT NULL,
[AppliedDate] [datetime] NULL,
[ApprovedDate] [datetime] NULL,
[AdvanceStatus] [varchar](100) NULL,
[AdvanceFromEngineerID] [bigint] NULL,
[AdvanceToEngineerID] [bigint] NULL,
[AccountResourceID] [bigint] NULL,
[AdvanceAmount] [float] NULL,
[ApprovedAdvanceAmount] [float] NULL,
[POrderID] [bigint] NULL,
[SiteID] [bigint] NULL,
 CONSTRAINT [PK_AdvanceMST] PRIMARY KEY CLUSTERED 
(
[AdvanceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF,     ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

This is the error message
Computed column ‘Month’ in table ‘Tmp_AdvanceMST’ cannot be persisted because the column is non-deterministic.

I am not able to understand what does this error message mean and how to solve this problem in order to make it IsPersisted=true

  • 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-25T09:57:45+00:00Added an answer on May 25, 2026 at 9:57 am

    The datename function can return different results dependant on the language of the logged in user hence is not deterministic. Marking a computed column as persisted means SQL Server stores the results of the computation which requires there to be exactly one result.

    If you need this as persisted at all you can replace with a 12 branch case expression with the specific language you want used.

    Although it would probably be all round better to have month(AppliedDate) as a persisted integer column and have the datename function in a non persisted computed column.

    Edited to give example as per comments

    CREATE TABLE #T
      (
         [AppliedDate] DATETIME,
         [Month] AS CASE MONTH([AppliedDate])
              WHEN 1 THEN 'January'
              WHEN 2 THEN 'February'
              WHEN 3 THEN 'March'
              WHEN 4 THEN 'April'
              WHEN 5 THEN 'May'
              WHEN 6 THEN 'June'
              WHEN 7 THEN 'July'
              WHEN 8 THEN 'August'
              WHEN 9 THEN 'September'
              WHEN 10 THEN 'October'
              WHEN 11 THEN 'November'
              WHEN 12 THEN 'December'
            END PERSISTED
      )  
    
      INSERT INTO #T([AppliedDate]) VALUES (GETDATE())
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting the following error when I try to install one of my ClickOnce
i am getting this error does some one knows about it??? 2009-07-08 18:42:36.778 FlashCards[1297:20b]
I just started getting this error today, seemingly out of nowhere. Any one see
My question is very similar to this one: Getting an error in jQuery when
Trying to get MGTwitterEngine app to build. Getting one pesky error. The following ERROR.
One of our programs is sometimes getting an OutOfMemory error on one user's machine,
I am getting a Microsoft JScript runtime error: 'Sys' is undefined error on one
Iam getting the following error , could some one help me how to fix
I'm getting an error on the production env but not on the local one.
I'm getting this error (Distributed transaction completed. Either enlist this session in a new

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.