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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:28:52+00:00 2026-05-24T00:28:52+00:00

Using the AdventureWorks Sample DB before I even work on it in on my

  • 0

Using the AdventureWorks Sample DB before I even work on it in on my dev server, I have created a view (Vx_CustomerAddressUpdate) and a custom table (Cx_CustomerAddressUpdate).

CREATE VIEW Vx_CustomerAddressUpdate AS 
SELECT Sales.customer.AccountNumber, 
   Sales.Customer.CustomerType, 
   Sales.Customer.ModifiedDate, 
   Sales.CustomerAddress.ModifiedDate, 
   person.Address.AddressLine1, 
   person.Address.AddressLine2, 
   person.Address.City, 
   Person.Address.PostalCode, 
   Person.StateProvince.Name, 
   Person.CountryRegion.Name
FROM Sales.Customer INNER JOIN Sales.CustomerAddress 
   ON Sales.Customer.CustomerID=Sales.CustomerAddress.CustomerID 
   INNER JOIN Person.Address 
   ON Sales.CustomerAddress.AddressID=Person.Address.AddressID 
   INNER JOIN Person.StateProvince 
   ON person.Address.StateProvinceID=Person.StateProvince.StateProvinceID 
   INNER JOIN Person.CountryRegion ON 
   Person.StateProvince.CountryRegionCode=Person.CountryRegion.CountryRegionCode
WHERE Person.CountryRegion.CountryRegionCode = 'US'

The stored procedure will daily insert the view rows into the custom table. The custom table has an additional field to track the date the each row was added to the custom table, which needs to be updated during the insert.

IF EXISTS (
    SELECT *
        FROM sys.procedures
    WHERE schema_id=schema_id('dbo')
    AND name = N'usp_CustomerAddressUpdate') 
DROP PROCEDURE dbo.usp_CustomerAddressUpdate
GO
CREATE PROCEDURE usp_CustomerAddressUpdate
AS
BEGIN
    SET NOCOUNT ON;
SELECT * INTO Cx_CustomerAddressUpdate 
FROM dbo.Vx_CustomerAddressUpdate
END
GO

The current challenges I’m facing are:

  1. SELECT INTO creates a new table. I need to insert into to an existing table. All of the solutions I’ve found for this are designed for explicit values.

  2. I’ve also tried SELECT INTO #temptable, but I face the same issues as above when it comes to pushing those results into the custom table.

  3. OPENROWSET seems to be overkill for an SP running on a local server

  • 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-24T00:28:53+00:00Added an answer on May 24, 2026 at 12:28 am

    What about the typical Insert into syntax:

    Insert Into Cx_CustomerAddressUpdate (<column list>,dateAdded)
    Select <columns>,getdate() as dateAdded
    From dbo.Vx_CustomerAddressUpdate
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, using SQL Server 2008. On my web page I have a textbox with
I'm using AdventureWorks sample database in a project. I can display the Customer's (being
Using SQL Server 2005 Leave Table ID StartDate EndDate 001 02/03/2010 02/03/2010 002 02/03/2010
I'm using AdventureWorks as a database to get familiar with linq and asp.net interface
I'll be using the AdventureWorks Database to illustrate my problem. I need to show
Using online interfaces to a version control system is a nice way to have
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
I'm using ADO.NET entity framework, and am using an AdventureWorks database attached to my
Using android 2.3.3, I have a background Service which has a socket connection. There's
Using the following as an example (with $db being a previously created database connection

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.