6 Replies Latest reply on Mar 20, 2008 3:32 AM by phoffmann

    Query to delete Devices

    Rookie

       

      Hello,

       

       

      does everybody have a query to delete devices on the SQL-Server? LDM Version 8.7 SP4 and SP5. Or is their a technical problem to delete devices form outside the console?

       

       

      Thanks

       

       

      Ralf

       

       

        • 1. Re: Query to delete Devices
          phoffmann SupportEmployee

          There is "no problem" per se.

           

          There's just an awful lot of tables, some of which may have dynamic content (i.e. custom data), which you need to trawl through, or the constraints will stop you dead in the water). If you want to have a look at what's happening, run SQL profiler as you delete an inventory - it's quite an act :).

           

          There is no reason why you technically can't do it - it's just a bit of an effort to do it, and it's usually easier doing it through the console. There is no secret command-line command to "delete node X", if that's what you're looking for.

           

          Paul Hoffmann

          LANDesk EMEA Technical Lead.

          1 of 1 people found this helpful
          • 2. Re: Query to delete Devices
            Apprentice

            Someone may have a query out there, but I wouldn't recommend doing this. Just because information for machines is kept in tables all over the database.

            • 3. Re: Query to delete Devices
              Rookie

               

              Thank you for the answer.

               

               

              Is the "delete node " command an coreserver command? And what is X, the nodename or the Device_ID?

               

               

              Ralf

               

               

              • 4. Re: Query to delete Devices
                Rookie
                Doerrenberg wrote:

                Thank you for the answer.

                 

                Is the "delete node " command an coreserver command? And what is X, the nodename or the Device_ID?

                 

                 

                Ralf

                 

                 

                 

                 

                wow.

                • 5. Re: Query to delete Devices
                  LANDave SupportEmployee

                   

                  I think what Paul was trying to say is we would *highly discourage* users from deleting computers through a SQL query.   The likelihood of messing something up is very high.

                   

                   

                   

                   

                   

                  • 6. Re: Query to delete Devices
                    phoffmann SupportEmployee

                    Correct.

                     

                    Deleting users through SQL is pretty much fine, as that's a comparably short list of tables that are affected, and there is already a script on droppedpackets.org out for it.

                     

                    Deleting DEVICES is a wholly different can of worms, and requires you to go through pretty much EVERY single table, and in the right order (due to constraints), which is a varying list depending on what add-ons have been installed. Devices should simply be deleted through the console, or at best if completely required - you can try through the SDK. I'm not 100% sure there is a command in the SDK to do this, but that's about the only "external" method I can think of at this point that would actually make sense in working.

                     

                    But I would certainly discourage using straight SQL. Not because it's not possible (it very certainly is) - but because the risk of messing it up somewhere is potentially very high, and you can end up with orphaned data (at best) and all sorts of nasty stuff to falsify any data you have as worst.

                     

                    Paul  Hoffmann

                    LANDesk EMEA Technical Lead.