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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:52:35+00:00 2026-05-29T10:52:35+00:00

Given the following tables: CREATE TABLE #USGS_24K_TOPOMAP_BOUNDARIES( [OBJECTID] [int] NOT NULL, [AREA] [numeric](38, 8)

  • 0

Given the following tables:

CREATE TABLE #USGS_24K_TOPOMAP_BOUNDARIES(
    [OBJECTID] [int] NOT NULL,
    [AREA] [numeric](38, 8) NULL,
    [PERIMETER] [numeric](38, 8) NULL,
    [QD24K_GRSM] [numeric](38, 8) NULL,
    [QD24K_GR_1] [numeric](38, 8) NULL,
    [QUADID] [numeric](38, 8) NULL,
    [CENTLAT] [numeric](38, 8) NULL,
    [CENTLONG] [numeric](38, 8) NULL,
    [NAME] [nvarchar](35) NULL,
    [STATE] [nvarchar](2) NULL,
    [LATLONG] [nvarchar](9) NULL,
    [OHIO_INDEX] [nvarchar](8) NULL,
    [GRID60] [nvarchar](5) NULL,
    [Reviewed] [int] NULL,
    [Corrected] [int] NULL,
    [Verified] [int] NULL,
    [GlobalID] [uniqueidentifier] NOT NULL,
    [SHAPE] [geometry] NULL)

and

CREATE TABLE #tbl_locations(

[OBJECTID] [int] NOT NULL,
[FCategory] [varchar](16) NULL,
[MapMethod] [varchar](4) NULL,
[HError] [varchar](50) NULL,
[MapSource] [varchar](255) NULL,
[SourceDate] [datetime2](7) NULL,
[EditDate] [datetime2](7) NULL,
[Notes] [varchar](255) NULL,
[Species_Community] [varchar](50) NULL,
[Location_ID] [uniqueidentifier] NOT NULL,
[Site_ID] [uniqueidentifier] NULL,
[GIS_Location_ID] [varchar](50) NULL,
[Meta_MID] [varchar](50) NULL,
[X_Coord] [numeric](38, 8) NULL,
[Y_Coord] [numeric](38, 8) NULL,
[Coord_Units] [varchar](50) NULL,
[Coord_System] [varchar](50) NULL,
[UTM_Zone] [varchar](50) NULL,
[Accuracy_Notes] [varchar](255) NULL,
[Unit_Code] [varchar](12) NULL,
[Loc_Name] [varchar](100) NULL,
[Loc_Type] [varchar](25) NULL,
[Updated_Date] [varchar](50) NULL,
[Loc_Notes] [varchar](255) NULL,
[Datum] [varchar](5) NULL,
[Watershed] [varchar](50) NULL,
[StreamName] [varchar](50) NULL,
[NHDReachCode] [varchar](14) NULL,
[TOPO_NAME] [varchar](50) NULL,
[Trail] [varchar](100) NULL,
[Road] [varchar](50) NULL,
[Elevation] [numeric](38, 8) NULL,
[LAT] [numeric](38, 8) NULL,
[LON] [numeric](38, 8) NULL,
[Population_ID] [uniqueidentifier] NULL,
[Year_] [varchar](4) NULL,
[WGS_DAT] [varchar](5) NULL,
[WGS_CS] [varchar](5) NULL,
[County] [varchar](20) NULL,
[State] [varchar](15) NULL,
[IsExtant] [varchar](3) NULL,
[IsSenstive] [varchar](3) NULL,
[SpeciesName] [varchar](125) NULL,
[SpeciesID] [varchar](50) NULL,
[Species_ID] [int] NULL,
[SHAPE] [geometry] NULL)

I’d like to populate #tbl_locations.Topo_Name with #USGS_24K_TOPOMAP_BOUNDARIES.Name. In other words, I trying to determine the name of the topo map that a point falls within, and programatically write that to the points table. Seems simple in theory, but tbl_locations contains thousands of points which could occur in one of 36 topo map polygon boundaries.

I’ve gotten this far

Select NAME, Loc_Name, Location_ID
From #USGS_24K_TOPOMAP_BOUNDARIES a, #TBL_LOCATIONS b
where a.Shape.STContains(b.Shape)=1

which returns a neat table that I can cross-walk back to tbl_locations through a join, but I’m stuck on getting this accomplished through a single query-update statement, and I have many similar point-polygon relationships that I’d like to automate this way (e.g what watershed, county, state, etc… the point occurs in). THanks!

  • 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-29T10:52:35+00:00Added an answer on May 29, 2026 at 10:52 am
    update TBL_LOCATIONS
    set TOPO_NAME = dbo.QD24K_GRSM.NAME
    --(SELECT     a.NAME, b.Loc_Name, b.Location_ID
    FROM dbo.tbl_locations
    inner join dbo.QD24K_GRSM 
    on TBL_LOCATIONS.Location_ID = TBL_LOCATIONS.Location_ID
    WHERE  (QD24K_GRSM.Shape.STContains(TBL_LOCATIONS.SHAPE) = 1) ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following tables: CREATE TABLE Employees ( first_name VARCHAR(50) NOT NULL, last_name VARCHAR(50)
Given the following tables: CREATE TABLE tree ( id serial NOT NULL, name character
Given the following table: create table TreeNode ( ID int not null primary key,
Given the following (heavily simplified) tables: create table Tags ( TagId int Primary Key
The tables CREATE TABLE `pending` ( `auto_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(255)
Given the following table structure: CREATE TABLE IF NOT EXISTS `roles` ( `id` int(11)
I have the following table: CREATE TABLE [dbo].[PartsWork]( [parts_work_id] [int] IDENTITY(1,1) NOT NULL, [experiment_id]
Given the following tables: CREATE TABLE IF NOT EXISTS `rank` ( `rank_id` bigint(20) NOT
Say I have the following 2 tables, CREATE TABLE t1( name VARCHAR(25) NOT NULL,
Imagine the following tables: create table boxes( id int, name text, ...); create table

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.