hi all,
i want to develop some script to configure sql externally, can anyone
tell me how can i do so' and wether this is possible or not'
the type of configurations that i need, setting sa password, deleting
guest account,Remove sample databases, Audit Login events, Restrict
CmdExec rights to SysAdmins,...
i want to develop a script to enforce the configurations above by
executing this script
any ideas'?> the type of configurations that i need, setting sa password, deleting
> guest account,Remove sample databases, Audit Login events, Restrict
> CmdExec rights to SysAdmins,...
1) sp_password (setting sa password)
2) sp_dropsuer 'guest'
3) drop database 'dbname' (Remove sample databases)
4) Run sql server Profiler (Audit Login events)
5) Read "CmdExec jobs" in the BOL (Restrict CmdExec rights to SysAdmins),
sp_droprolemember system stored procedure
<Eng.Rana@.gmail.com> wrote in message
news:1163934268.329344.18750@.m73g2000cwd.googlegroups.com...
> hi all,
> i want to develop some script to configure sql externally, can anyone
> tell me how can i do so' and wether this is possible or not'
> the type of configurations that i need, setting sa password, deleting
> guest account,Remove sample databases, Audit Login events, Restrict
> CmdExec rights to SysAdmins,...
> i want to develop a script to enforce the configurations above by
> executing this script
> any ideas'?
>|||thanx for the reply :)
but how can i run these externally, shall i develope some code, using
.NET for example to call these stored procedures
or can i write some script to call them externally, all at once
Uri Dimant wrote:
> > the type of configurations that i need, setting sa password, deleting
> > guest account,Remove sample databases, Audit Login events, Restrict
> > CmdExec rights to SysAdmins,...
> 1) sp_password (setting sa password)
> 2) sp_dropsuer 'guest'
> 3) drop database 'dbname' (Remove sample databases)
> 4) Run sql server Profiler (Audit Login events)
> 5) Read "CmdExec jobs" in the BOL (Restrict CmdExec rights to SysAdmins),
> sp_droprolemember system stored procedure
>
> <Eng.Rana@.gmail.com> wrote in message
> news:1163934268.329344.18750@.m73g2000cwd.googlegroups.com...
> > hi all,
> >
> > i want to develop some script to configure sql externally, can anyone
> > tell me how can i do so' and wether this is possible or not'
> >
> > the type of configurations that i need, setting sa password, deleting
> > guest account,Remove sample databases, Audit Login events, Restrict
> > CmdExec rights to SysAdmins,...
> >
> > i want to develop a script to enforce the configurations above by
> > executing this script
> >
> > any ideas'?
> >|||Yep, you'll have to develop some code in T-SQL as well
<Eng.Rana@.gmail.com> wrote in message
news:1163936328.124164.100050@.m7g2000cwm.googlegroups.com...
> thanx for the reply :)
> but how can i run these externally, shall i develope some code, using
> .NET for example to call these stored procedures
> or can i write some script to call them externally, all at once
> Uri Dimant wrote:
>> > the type of configurations that i need, setting sa password, deleting
>> > guest account,Remove sample databases, Audit Login events, Restrict
>> > CmdExec rights to SysAdmins,...
>> 1) sp_password (setting sa password)
>> 2) sp_dropsuer 'guest'
>> 3) drop database 'dbname' (Remove sample databases)
>> 4) Run sql server Profiler (Audit Login events)
>> 5) Read "CmdExec jobs" in the BOL (Restrict CmdExec rights to SysAdmins),
>> sp_droprolemember system stored procedure
>>
>> <Eng.Rana@.gmail.com> wrote in message
>> news:1163934268.329344.18750@.m73g2000cwd.googlegroups.com...
>> > hi all,
>> >
>> > i want to develop some script to configure sql externally, can anyone
>> > tell me how can i do so' and wether this is possible or not'
>> >
>> > the type of configurations that i need, setting sa password, deleting
>> > guest account,Remove sample databases, Audit Login events, Restrict
>> > CmdExec rights to SysAdmins,...
>> >
>> > i want to develop a script to enforce the configurations above by
>> > executing this script
>> >
>> > any ideas'?
>> >
>|||Hi
Some of the things you are wanting to do may be configurable during the
installation see
http://msdn2.microsoft.com/en-us/library/ms144259.aspx if using SQL2005. You
may also want to look at using SMO.
John
"Eng.Rana@.gmail.com" wrote:
> hi all,
> i want to develop some script to configure sql externally, can anyone
> tell me how can i do so' and wether this is possible or not'
> the type of configurations that i need, setting sa password, deleting
> guest account,Remove sample databases, Audit Login events, Restrict
> CmdExec rights to SysAdmins,...
> i want to develop a script to enforce the configurations above by
> executing this script
> any ideas'?
>|||thanx John
but actually i don want to do so while installation, i want to run such
a script to recfonfigure the already installed SQLs, to be secure :)
i'm using SQL 2000
John Bell wrote:
> Hi
> Some of the things you are wanting to do may be configurable during the
> installation see
> http://msdn2.microsoft.com/en-us/library/ms144259.aspx if using SQL2005. You
> may also want to look at using SMO.
> John
> "Eng.Rana@.gmail.com" wrote:
> > hi all,
> >
> > i want to develop some script to configure sql externally, can anyone
> > tell me how can i do so' and wether this is possible or not'
> >
> > the type of configurations that i need, setting sa password, deleting
> > guest account,Remove sample databases, Audit Login events, Restrict
> > CmdExec rights to SysAdmins,...
> >
> > i want to develop a script to enforce the configurations above by
> > executing this script
> >
> > any ideas'?
> >
> >|||thanx :)
but isn't there any other way to do the same job'
Uri Dimant wrote:
> Yep, you'll have to develop some code in T-SQL as well
>
> <Eng.Rana@.gmail.com> wrote in message
> news:1163936328.124164.100050@.m7g2000cwm.googlegroups.com...
> > thanx for the reply :)
> > but how can i run these externally, shall i develope some code, using
> > .NET for example to call these stored procedures
> > or can i write some script to call them externally, all at once
> >
> > Uri Dimant wrote:
> >> > the type of configurations that i need, setting sa password, deleting
> >> > guest account,Remove sample databases, Audit Login events, Restrict
> >> > CmdExec rights to SysAdmins,...
> >>
> >> 1) sp_password (setting sa password)
> >> 2) sp_dropsuer 'guest'
> >> 3) drop database 'dbname' (Remove sample databases)
> >> 4) Run sql server Profiler (Audit Login events)
> >> 5) Read "CmdExec jobs" in the BOL (Restrict CmdExec rights to SysAdmins),
> >> sp_droprolemember system stored procedure
> >>
> >>
> >>
> >> <Eng.Rana@.gmail.com> wrote in message
> >> news:1163934268.329344.18750@.m73g2000cwd.googlegroups.com...
> >> > hi all,
> >> >
> >> > i want to develop some script to configure sql externally, can anyone
> >> > tell me how can i do so' and wether this is possible or not'
> >> >
> >> > the type of configurations that i need, setting sa password, deleting
> >> > guest account,Remove sample databases, Audit Login events, Restrict
> >> > CmdExec rights to SysAdmins,...
> >> >
> >> > i want to develop a script to enforce the configurations above by
> >> > executing this script
> >> >
> >> > any ideas'?
> >> >
> >|||Have a .sql file containing the commands, which you kick off using SQLCMD.EXE or OSQL.EXE?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<Eng.Rana@.gmail.com> wrote in message news:1163953498.340666.124840@.f16g2000cwb.googlegroups.com...
> thanx :)
> but isn't there any other way to do the same job'
> Uri Dimant wrote:
>> Yep, you'll have to develop some code in T-SQL as well
>>
>> <Eng.Rana@.gmail.com> wrote in message
>> news:1163936328.124164.100050@.m7g2000cwm.googlegroups.com...
>> > thanx for the reply :)
>> > but how can i run these externally, shall i develope some code, using
>> > .NET for example to call these stored procedures
>> > or can i write some script to call them externally, all at once
>> >
>> > Uri Dimant wrote:
>> >> > the type of configurations that i need, setting sa password, deleting
>> >> > guest account,Remove sample databases, Audit Login events, Restrict
>> >> > CmdExec rights to SysAdmins,...
>> >>
>> >> 1) sp_password (setting sa password)
>> >> 2) sp_dropsuer 'guest'
>> >> 3) drop database 'dbname' (Remove sample databases)
>> >> 4) Run sql server Profiler (Audit Login events)
>> >> 5) Read "CmdExec jobs" in the BOL (Restrict CmdExec rights to SysAdmins),
>> >> sp_droprolemember system stored procedure
>> >>
>> >>
>> >>
>> >> <Eng.Rana@.gmail.com> wrote in message
>> >> news:1163934268.329344.18750@.m73g2000cwd.googlegroups.com...
>> >> > hi all,
>> >> >
>> >> > i want to develop some script to configure sql externally, can anyone
>> >> > tell me how can i do so' and wether this is possible or not'
>> >> >
>> >> > the type of configurations that i need, setting sa password, deleting
>> >> > guest account,Remove sample databases, Audit Login events, Restrict
>> >> > CmdExec rights to SysAdmins,...
>> >> >
>> >> > i want to develop a script to enforce the configurations above by
>> >> > executing this script
>> >> >
>> >> > any ideas'?
>> >> >
>> >
>|||thanx Tibor :)
what if i want to take an exteranl args from users like the new sa
password for example
Tibor Karaszi wrote:
> Have a .sql file containing the commands, which you kick off using SQLCMD.EXE or OSQL.EXE?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> <Eng.Rana@.gmail.com> wrote in message news:1163953498.340666.124840@.f16g2000cwb.googlegroups.com...
> > thanx :)
> > but isn't there any other way to do the same job'
> >
> > Uri Dimant wrote:
> >> Yep, you'll have to develop some code in T-SQL as well
> >>
> >>
> >>
> >> <Eng.Rana@.gmail.com> wrote in message
> >> news:1163936328.124164.100050@.m7g2000cwm.googlegroups.com...
> >> > thanx for the reply :)
> >> > but how can i run these externally, shall i develope some code, using
> >> > .NET for example to call these stored procedures
> >> > or can i write some script to call them externally, all at once
> >> >
> >> > Uri Dimant wrote:
> >> >> > the type of configurations that i need, setting sa password, deleting
> >> >> > guest account,Remove sample databases, Audit Login events, Restrict
> >> >> > CmdExec rights to SysAdmins,...
> >> >>
> >> >> 1) sp_password (setting sa password)
> >> >> 2) sp_dropsuer 'guest'
> >> >> 3) drop database 'dbname' (Remove sample databases)
> >> >> 4) Run sql server Profiler (Audit Login events)
> >> >> 5) Read "CmdExec jobs" in the BOL (Restrict CmdExec rights to SysAdmins),
> >> >> sp_droprolemember system stored procedure
> >> >>
> >> >>
> >> >>
> >> >> <Eng.Rana@.gmail.com> wrote in message
> >> >> news:1163934268.329344.18750@.m73g2000cwd.googlegroups.com...
> >> >> > hi all,
> >> >> >
> >> >> > i want to develop some script to configure sql externally, can anyone
> >> >> > tell me how can i do so' and wether this is possible or not'
> >> >> >
> >> >> > the type of configurations that i need, setting sa password, deleting
> >> >> > guest account,Remove sample databases, Audit Login events, Restrict
> >> >> > CmdExec rights to SysAdmins,...
> >> >> >
> >> >> > i want to develop a script to enforce the configurations above by
> >> >> > executing this script
> >> >> >
> >> >> > any ideas'?
> >> >> >
> >> >
> >|||> what if i want to take an exteranl args from users like the new sa
> password for example
SQLCMD.EXE (shipped with 2005) has support for variables. In the script file, you specify $(varname)
and when you run the script, you use the -v option to specify a value for a variable. But it
definitely seems like you should provide the end-user with a proper small app to do these changes.
Much more robust...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<Eng.Rana@.gmail.com> wrote in message news:1163957220.279868.20100@.e3g2000cwe.googlegroups.com...
> thanx Tibor :)
> what if i want to take an exteranl args from users like the new sa
> password for example
> Tibor Karaszi wrote:
>> Have a .sql file containing the commands, which you kick off using SQLCMD.EXE or OSQL.EXE?
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> <Eng.Rana@.gmail.com> wrote in message
>> news:1163953498.340666.124840@.f16g2000cwb.googlegroups.com...
>> > thanx :)
>> > but isn't there any other way to do the same job'
>> >
>> > Uri Dimant wrote:
>> >> Yep, you'll have to develop some code in T-SQL as well
>> >>
>> >>
>> >>
>> >> <Eng.Rana@.gmail.com> wrote in message
>> >> news:1163936328.124164.100050@.m7g2000cwm.googlegroups.com...
>> >> > thanx for the reply :)
>> >> > but how can i run these externally, shall i develope some code, using
>> >> > .NET for example to call these stored procedures
>> >> > or can i write some script to call them externally, all at once
>> >> >
>> >> > Uri Dimant wrote:
>> >> >> > the type of configurations that i need, setting sa password, deleting
>> >> >> > guest account,Remove sample databases, Audit Login events, Restrict
>> >> >> > CmdExec rights to SysAdmins,...
>> >> >>
>> >> >> 1) sp_password (setting sa password)
>> >> >> 2) sp_dropsuer 'guest'
>> >> >> 3) drop database 'dbname' (Remove sample databases)
>> >> >> 4) Run sql server Profiler (Audit Login events)
>> >> >> 5) Read "CmdExec jobs" in the BOL (Restrict CmdExec rights to SysAdmins),
>> >> >> sp_droprolemember system stored procedure
>> >> >>
>> >> >>
>> >> >>
>> >> >> <Eng.Rana@.gmail.com> wrote in message
>> >> >> news:1163934268.329344.18750@.m73g2000cwd.googlegroups.com...
>> >> >> > hi all,
>> >> >> >
>> >> >> > i want to develop some script to configure sql externally, can anyone
>> >> >> > tell me how can i do so' and wether this is possible or not'
>> >> >> >
>> >> >> > the type of configurations that i need, setting sa password, deleting
>> >> >> > guest account,Remove sample databases, Audit Login events, Restrict
>> >> >> > CmdExec rights to SysAdmins,...
>> >> >> >
>> >> >> > i want to develop a script to enforce the configurations above by
>> >> >> > executing this script
>> >> >> >
>> >> >> > any ideas'?
>> >> >> >
>> >> >
>> >
>