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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:34:40+00:00 2026-06-10T18:34:40+00:00

Below is part of a SQL triggered that uses a subquery to return a

  • 0

Below is part of a SQL triggered that uses a subquery to return a value in the column TableString. The subquery will return the first two value and the “marker” for Fname, however nothing after that (not even the semicolon). The TableString column is an nvarchar that is set to 255 characters and captures all similar data during an insert or an update.

INSERT INTO TransactionLog (TransactionDate, Operator, TableName, Action
                           , TableString, UserId)
SELECT LastChangeDate
     , 'Op'
     , @tableName
     , @action
     , CAST('sNum:' + CAST(sNumber as nvarchar(10)) + ' entType:' + EntityType 
            + ' Fname:' + ISNULL(FirstName, 'NULL') 
            + ' Lname:' + ISNULL(LastName, 'NULL') 
            + ' suff:' + ISNULL(NameSuffix, 'NULL') 
            + ' corpName:' + ISNULL(CorporateName, 'NULL' ) 
            + ' ctrlId:' + ISNULL(CAST(ControlId as nvarchar(3)), 'NULL') 
            AS nvarchar(30)) as TableString
     , LastChangeOperator
FROM deleted

Returned values in TableString:

sNum:1000024 entType:S Fname
  • 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-06-10T18:34:42+00:00Added an answer on June 10, 2026 at 6:34 pm

    This has nothing to do with ISNULL but rather, is the result of a truncation of data.

    Pay attention to:

    .. AS nvarchar(30)
    

    That is, much more data is being omitted. (The output does not even contain “Fname:” in this case.)

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

Sidebar

Related Questions

See the excerpt below taken from a PL/SQL tutorial. The part I have an
I have a SQL query that I'm currently solving by doing two queries. I
The CUST table below will be joined with ~10 tables. For this subquery in
Below is part of a library that generates lists of models.... the ->getBy() portion
I'm having trouble with the sql below. Basically I have rows that contains strings
The code below is from a Sinatra app (that uses DataMappe), which I am
I am trying to use two linq-to-SQL statements to return data to an array
below I have a query that will get the most common user agents for
The below cross apply sql statement is the only part of a stored proc
I have the below LINQ to SQL method that takes an inordinate amount of

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.