Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. MSSQL 2005 Drop / Create [Answered]

MSSQL 2005 Drop / Create [Answered]

Scheduled Pinned Locked Moved Database
sql-serverquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mike Osbahr
    wrote on last edited by
    #1

    If I drop / create a table in MSSQL 2005 will all of the dependent views still work?

    Thanx, >>>-----> MikeO

    S B 2 Replies Last reply
    0
    • M Mike Osbahr

      If I drop / create a table in MSSQL 2005 will all of the dependent views still work?

      Thanx, >>>-----> MikeO

      S Offline
      S Offline
      Simon_Whale
      wrote on last edited by
      #2

      if i get your question right If you drop a table that is used in a view will it still work? the answer is no you will get binding error if you then recreate said table? then yes the view will work. hope that answers your question

      Marc Clifton wrote:

      That has nothing to do with VB. - Oh crap. I just defended VB!

      M 1 Reply Last reply
      0
      • S Simon_Whale

        if i get your question right If you drop a table that is used in a view will it still work? the answer is no you will get binding error if you then recreate said table? then yes the view will work. hope that answers your question

        Marc Clifton wrote:

        That has nothing to do with VB. - Oh crap. I just defended VB!

        M Offline
        M Offline
        Mike Osbahr
        wrote on last edited by
        #3

        The question is will I have to drop and create each view again?

        Thanx, >>>-----> MikeO

        S 1 Reply Last reply
        0
        • M Mike Osbahr

          The question is will I have to drop and create each view again?

          Thanx, >>>-----> MikeO

          S Offline
          S Offline
          Simon_Whale
          wrote on last edited by
          #4

          i create a test script to try out your question and i didn't have to recreate the view. but you will have take into account indexes etc.

          Marc Clifton wrote:

          That has nothing to do with VB. - Oh crap. I just defended VB!

          M 1 Reply Last reply
          0
          • S Simon_Whale

            i create a test script to try out your question and i didn't have to recreate the view. but you will have take into account indexes etc.

            Marc Clifton wrote:

            That has nothing to do with VB. - Oh crap. I just defended VB!

            M Offline
            M Offline
            Mike Osbahr
            wrote on last edited by
            #5

            I have created scripts for the indexes and triggers. The list of dependents is quite long though, so I don't want to create too much of a mess. Thank you for running the test. I should have thought of that.

            Thanx, >>>-----> MikeO

            1 Reply Last reply
            0
            • M Mike Osbahr

              If I drop / create a table in MSSQL 2005 will all of the dependent views still work?

              Thanx, >>>-----> MikeO

              B Offline
              B Offline
              Bernhard Hiller
              wrote on last edited by
              #6

              Do you just want to get rid of all records in that table? Then try a TRUNCATE TABLE query.

              M 1 Reply Last reply
              0
              • B Bernhard Hiller

                Do you just want to get rid of all records in that table? Then try a TRUNCATE TABLE query.

                M Offline
                M Offline
                Mike Osbahr
                wrote on last edited by
                #7

                What I am trying to do is find out why a query that used to take 10ms is now taking 3 seconds to return a record set. I was hoping that dropping and then creating the table again might fix whatever had changed. There are only about 7000 records in the table most of the time, so a query should not take that long. I have followed up on this thread with a new question: A-tale-of-two-queries[^] If you have any insight on 'Audit Login' I would appreciate hearing about it.

                Thanx, >>>-----> MikeO

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups