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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:58:37+00:00 2026-06-05T23:58:37+00:00

I have got a table in an SQL Server 2008 R2 database. It contains

  • 0

I have got a table in an SQL Server 2008 R2 database. It contains X, Y and Shape columns for storing numeric(38, 8) for Longitude and Latitude and Computed Column for Geometry type. The idea is whenever X and Y are inserted, Shape column should automatically be filled with the correct Geometry data.

X and Y are populated. However, I have been unsuccessful in specifying the Shape column. In SQL Server Management Studio, it gave me errors of failing validating formula when I populated either of the following codes in Formula of Computed Column Specification:

(STGeomFromText('POINT (' + CAST([x] as varchar(32)) + ' ' + CAST([y] as varchar(32)) + ')', 4283))

OR

([STGeomFromText]('POINT (' + CAST([x] as varchar(32)) + ' ' + CAST([y] as varchar(32)) + ')', 4283))

Could anyone give me a hand? Thanks!

Cheers,
Alex

  • 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-05T23:58:38+00:00Added an answer on June 5, 2026 at 11:58 pm

    I was actually then enlightened by this post.

    Hope it helps to anybody else who has the same question.

    ALTER TABLE LOCATION
    ADD Shape AS (CONVERT(GEOMETRY, CASE WHEN x<> 0
                                        AND y<> 0
                                   THEN GEOMETRY::STGeomFromText('POINT('
                                                              + CONVERT(VARCHAR, x)
                                                              + ' '
                                                              + CONVERT(VARCHAR, y)
                                                              + ')', 4238)
                                   ELSE NULL
                              END))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a following table in SQL Server 2008 database: CREATE TABLE [dbo].[Actions]( [ActionId]
I have this table structure on a SQL Server 2008 R2 database: CREATE TABLE
I got the following trigger on my sql server 2008 database CREATE TRIGGER tr_check_stoelen
I am using SQL Server 2008, and I have two tables Table1 contains 3.5
I have got hold of a sql server 2008 developer edition and this is
In a SQL Server 2008 database, I have a column with multiple values separated
System is: SQL Server 2008-R2 I have a table that one of its column
I have a single table in the Sql Server 2008 r2 DB. Every few
i have 3 tables in sql-server 2008 table A , table B , Table
I'm using SQL Server 2008. I've got a column NVARCHAR(MAX) in a table which

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.