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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:33:32+00:00 2026-06-03T10:33:32+00:00

I need to create a view, however the data is generated from an application

  • 0

I need to create a view, however the data is generated from an application with its own db management for tables which based on column count can create over 7 SQL Server tables for one internal table definition.

The tables all end with [‘m’ & number], eg devicem1, devicem2 … devicem10

They all contain logical_name as their primary key, but you can never rely on which table will hold any other column in the internal table!

I need to create a view that joins the tables together as just device so when the application changes it doesn’t mess up any stored procs I want to create.

Based on this query:

CREATE VIEW device AS
   SELECT *
   FROM devicem1 m1, devicem2 m2, devicem3 m3, ... devicem10 m10
   WHERE m1.logical_name = m2.logical_name
   AND m1.logical_name = m3.logical_name
   ...
   AND m1.logical_name = m10.logical_name

Is there some way to join ten tables where I can ignore the fact that devicem9 & devicem10 may not exist?

  • 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-03T10:33:33+00:00Added an answer on June 3, 2026 at 10:33 am

    With regards to the requirements of a view. The tables referenced MUST exist when the view is created. The SQL engine isn’t going to allow you to create a view referencing tables that don’t exist.

    Considering that a view is just a stored select statement, after it’s created the tables can be deleted (as long as schema-binding isn’t in play); however any time you call or use the view all referenced tables must exist or it will toss an error.

    Also, you CAN change the schema of referenced tables as long as it doesn’t remove any fields specifically used in the view but again, if a specific column used by the view is missing any query using the view will fail.

    You might have more luck getting away with what your trying to do with some creative table valued functions and dynamic sql. A table valued function is basically just a view that allows parameters and extended logic.

    All in all, I would say what your describing sounds a little sketchy though.

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

Sidebar

Related Questions

tl;dr: I need to show data from two different tables in the list view
I have an application in which I need to create mx.states.State objects on the
In my app, I create view controller objects as I need them. When a
I understand that we need to create MXML file to define a view. Suppose
UPDATED: I am using MySQL statement to create a view: I need to show
I am developing a project at work for which I need to create and
I need to create a web application that prints checks. Because of the nature
I'm using a view-based NSOutlineView to create a source list. The NSOutlineView is connected
I have created an entity data model from my database. however in certain areas
I have a need to use Tabs in my application and so have based

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.