I want to save my records in excel file for this I have to use openrowset in my query . It throws my error of AdHoc Quaries is disable on you server contact your administrator.
If you are using sqlserver 2005 or 2008 then follow this pictorial represenstation this is one way
and easy way :)
click on surface area configuraiton for feature and then you see screen below.
enable this adhoc query option and enjoy.
there is another way which is manual way for this follow this link