Can i have a script that will enable the auto-create stats on every database
in one click if not already done so ?
Thanks
Hi,
Execute the below query. This will enable Auto create statistics in all
databases.
EXEC sp_MSforeachdb @.command1="sp_dboption '?','auto create
statistics','true'"
Thanks
Hari
SQL Server MVP
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23WkwPwP3GHA.3464@.TK2MSFTNGP03.phx.gbl...
> Can i have a script that will enable the auto-create stats on every
> database in one click if not already done so ?
> Thanks
>
Showing posts with label enable. Show all posts
Showing posts with label enable. Show all posts
Friday, March 23, 2012
script to enable auto-create stats on all databases
Can i have a script that will enable the auto-create stats on every database
in one click if not already done so ?
ThanksHi,
Execute the below query. This will enable Auto create statistics in all
databases.
EXEC sp_MSforeachdb @.command1="sp_dboption '?','auto create
statistics','true'"
Thanks
Hari
SQL Server MVP
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23WkwPwP3GHA.3464@.TK2MSFTNGP03.phx.gbl...
> Can i have a script that will enable the auto-create stats on every
> database in one click if not already done so ?
> Thanks
>sql
in one click if not already done so ?
ThanksHi,
Execute the below query. This will enable Auto create statistics in all
databases.
EXEC sp_MSforeachdb @.command1="sp_dboption '?','auto create
statistics','true'"
Thanks
Hari
SQL Server MVP
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23WkwPwP3GHA.3464@.TK2MSFTNGP03.phx.gbl...
> Can i have a script that will enable the auto-create stats on every
> database in one click if not already done so ?
> Thanks
>sql
script to enable auto-create stats on all databases
Can i have a script that will enable the auto-create stats on every database
in one click if not already done so ?
ThanksHi,
Execute the below query. This will enable Auto create statistics in all
databases.
EXEC sp_MSforeachdb @.command1="sp_dboption '?','auto create
statistics','true'"
Thanks
Hari
SQL Server MVP
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23WkwPwP3GHA.3464@.TK2MSFTNGP03.phx.gbl...
> Can i have a script that will enable the auto-create stats on every
> database in one click if not already done so ?
> Thanks
>
in one click if not already done so ?
ThanksHi,
Execute the below query. This will enable Auto create statistics in all
databases.
EXEC sp_MSforeachdb @.command1="sp_dboption '?','auto create
statistics','true'"
Thanks
Hari
SQL Server MVP
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23WkwPwP3GHA.3464@.TK2MSFTNGP03.phx.gbl...
> Can i have a script that will enable the auto-create stats on every
> database in one click if not already done so ?
> Thanks
>
Friday, March 9, 2012
Script for copying data
Frinds,
How can i have a script to:
1- Disable all Foreign Keys and Constraints
2- Copy all data
3- Enable all Foreign Keys and Constraints
Actually, i need the commando to enable and disable a Foreign Key.
Thanks
Leandro L S
Vitória-ES
Brazilor just use ALTER TABLE <tablename> NOCHECK CONSTRAINT ALL if you wan tto
get them all.
Note that this only disables Foreign Keys and Check constraint and not
Primary keys or unique constraints
--
Jacco Schalkwijk MCDBA, MCSD, MCSE
Database Administrator
Eurostop Ltd.
"Dinesh.T.K" <tkdinesh@.nospam.mail.tkdinesh.com> wrote in message
news:eTitIcjbDHA.1280@.tk2msftngp13.phx.gbl...
> Leandro,
> --To disable a Foreign key constraint
> ALTER TABLE <tablename> NOCHECK CONSTRAINT <constraintname>
> --To enable it
> ALTER TABLE <tablename> CHECK CONSTRAINT <constraintname>
>
> --
> Dinesh.
> SQL Server FAQ at
> http://www.tkdinesh.com
> "Leandro Loureiro dos Santos" <leandro@.email.com> wrote in message
> news:%23rlB%23MjbDHA.1204@.TK2MSFTNGP12.phx.gbl...
> > Frinds,
> >
> > How can i have a script to:
> >
> > 1- Disable all Foreign Keys and Constraints
> > 2- Copy all data
> > 3- Enable all Foreign Keys and Constraints
> >
> > Actually, i need the commando to enable and disable a Foreign Key.
> >
> > Thanks
> > Leandro L S
> > Vitória-ES
> > Brazil
> >
> >
>
How can i have a script to:
1- Disable all Foreign Keys and Constraints
2- Copy all data
3- Enable all Foreign Keys and Constraints
Actually, i need the commando to enable and disable a Foreign Key.
Thanks
Leandro L S
Vitória-ES
Brazilor just use ALTER TABLE <tablename> NOCHECK CONSTRAINT ALL if you wan tto
get them all.
Note that this only disables Foreign Keys and Check constraint and not
Primary keys or unique constraints
--
Jacco Schalkwijk MCDBA, MCSD, MCSE
Database Administrator
Eurostop Ltd.
"Dinesh.T.K" <tkdinesh@.nospam.mail.tkdinesh.com> wrote in message
news:eTitIcjbDHA.1280@.tk2msftngp13.phx.gbl...
> Leandro,
> --To disable a Foreign key constraint
> ALTER TABLE <tablename> NOCHECK CONSTRAINT <constraintname>
> --To enable it
> ALTER TABLE <tablename> CHECK CONSTRAINT <constraintname>
>
> --
> Dinesh.
> SQL Server FAQ at
> http://www.tkdinesh.com
> "Leandro Loureiro dos Santos" <leandro@.email.com> wrote in message
> news:%23rlB%23MjbDHA.1204@.TK2MSFTNGP12.phx.gbl...
> > Frinds,
> >
> > How can i have a script to:
> >
> > 1- Disable all Foreign Keys and Constraints
> > 2- Copy all data
> > 3- Enable all Foreign Keys and Constraints
> >
> > Actually, i need the commando to enable and disable a Foreign Key.
> >
> > Thanks
> > Leandro L S
> > Vitória-ES
> > Brazil
> >
> >
>
Subscribe to:
Posts (Atom)