[dba-SQLServer] Drop restore indexes

Arthur Fuller fuller.artful at gmail.com
Sun Mar 30 15:07:09 CDT 2008


It's built-in, JC. Once you've used the gui to build your table(s) and
indexes, then you can be in MSMS and right-click on either the db or a
selected table and select Script To and then choose your destination for
said script and you will see what click-click-type-click did behind the
scenes.

Not that I ever expect you to write a Cert for MS-SQL, JC, but this is a
good way to learn what's under the covers. And I also add, that virtually
all these IDEs are script languages in disguise. Some of the IDEs make this
readily apparent, such as Visual Studio, DreamWeaver, and others. Click here
and you see the Gui, click there and you see the code behind. In Access it's
a teensy bit more difficult to see, but export a form and then read the code
and you shall see what I mean. They are ALL scripting languages. If you like
the IDE then you like to click and drag and drop etc., but what's going on
under the covers is script-generation.

Back in the initial days of VS.NET there was a popular thread called
"Alternatives to .NET IDE" or similar. People noticed that the IDE cost
money but the framework didn't, and asked if there were an alternative IDE.
The classic answer was, "Yes, NotePad". A sword that cuts both ways: you can
learn the scripting language and write it free in NotePad or any other text
editor, or you can drag and drop and pay money for the privilege.

Last week I met a guy named John McKay who never never never used any of the
gui tools in SQL 2005+. He preferred to type in all the commands and he
could do it way more quickly than I could match, using the gui drag and drop
stuff. Admittedly, he came from a Linux and Oracle background, but he could
type so quickly and knew so precisely what he was doing that it blew me
away. I prefer to see a picture: use the gui interface, add tables and views
and udfs and so on, click this and drag there and I get the job done, but he
knew this stuff so well that he could simply type join this and join that
and presto, done in a fraction of the time it took me.

Back to the topic at hand. Once you've created what you want in the gui,
right-click at the appropriate level and then choose Generate Scripts.
Choose your output destination and click OK and you're there.

A.

On Sun, Mar 30, 2008 at 3:24 PM, Susan Harkins <ssharkins at gmail.com> wrote:

> You're looking for a third party tool as opposed to a dynamic procedure?
>
> Susan H.
> > set up to create the indexes.  I need to have some tool that will build
> > scripts to recreate the indexes fond on a table and then remoce the
> > indexes.
> > Once the records are appended, I need to then run the scripts to rebuild
> > all
> > the saved index scripts.
> >
> > Is there such a tool?
>
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
>
>



More information about the dba-SQLServer mailing list