what's the best way of importing a query from access to be a view in MSSQL2005?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anniebai
    New Member
    • Aug 2007
    • 51

    what's the best way of importing a query from access to be a view in MSSQL2005?

    I've struggled on this for 30 mins, it was really simple on SQL 2000, but now i am using 2005.
    I've tried the import/export wizard, the query is always automatically converted to a table. Is there a way to import the query to be a view in SQL 2005?
    THanks very much!
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    I haven't tried that myself but I think it's possible.

    1. [Create a view in sql server.
    2. Build your query using OPENROWSET (Check example C)

    Good luck

    -- CK

    Comment

    • anniebai
      New Member
      • Aug 2007
      • 51

      #3
      Thank you very much, CK. I'll give it a try.

      Originally posted by ck9663
      I haven't tried that myself but I think it's possible.

      1. [Create a view in sql server.
      2. Build your query using OPENROWSET (Check example C)

      Good luck

      -- CK

      Comment

      • taoh15
        New Member
        • Feb 2008
        • 5

        #4
        Hi

        This may seem realy silly but the easiest way is open up Access. Edit the query, change to SQL view, select all and copy.

        Now open SQL Server Management studio add a view, don't select any table and just paste into the SQL code windows, save and give it name.

        Cheers
        Taoh

        Comment

        • ck9663
          Recognized Expert Specialist
          • Jun 2007
          • 2878

          #5
          Taoh is right. My suggestion is for you to use the same view in Access.But if you're trying to migrate your entire database to ms-sql, you can just create a view in sql-server, which Taoh is suggesting. Here's the complete syntax.

          -- CK

          Comment

          • anniebai
            New Member
            • Aug 2007
            • 51

            #6
            thanks Taoh and CK.
            I don't understand why MSoft make this so difficult in 2005? does anyone know the reason behind?

            Comment

            Working...