Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I wanna create script my whole table, including all statistics and indexes.

In SSM, When I right click table and create script, it gives me script for Indexes for not for statistics.

If I right click indexes, then there is an option to generate script, but this option is disabled when I right click Statistics.

Can anyone tell me how do I generate script for statistics.

Thanks

share|improve this question
add comment

migrated from stackoverflow.com Apr 30 '13 at 7:50

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 4 down vote accepted

In SSMS, open Tools -> Options and go to the "SQL Server Object Explorer" item in the left-hand pane. Expand that and you should see a "Scripting" subitem. From there, navigate to the "Table and View Options" section and you should see an option to say whether statistics are scripted or not.

share|improve this answer
    
Great, its the answer, Thanks –  Muhammad Sharjeel Ahsan Apr 30 '13 at 6:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.