Dowt in create View

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • raabu
    New Member
    • Mar 2007
    • 1

    Dowt in create View

    I want to create a view from dynamic tables

    Query:

    CREATE VIEW dbo.TrialView
    AS
    SELECT *
    FROM (select name from dbo.sysobjects where name like 'scTabForm%' and type='u') p

    Output:
    Name
    scTabForm0
    scTabForm1

    But I want all the fields from table starts with 'scTabForm'

    like: select * from scTabForm0,scTa bForm1,...

    Regards
    Raabu
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    I think I know what you are getting at, but could you please clarify for me just a little bit? You have an unknown number of tables, with unknown structure. You want to create a view that will combine these and rename the columns to append the table they came from?

    Comment

    Working...