Showing posts with label develop. Show all posts
Showing posts with label develop. Show all posts

Tuesday, 20 March 2012

Connect to Analysis Services with specific username

Hello,

We are trying to develop an ASP .Net web application that connects to an SQL Server 2005 analysis services and executes MDX statements. We want the connection to be made using a specific user name that we specify in the code rather than having the web application inherit the logged on domain user account.

We tried to specifiy the user name in the connection string as follows, but it is still taking the logged in user account rather than the one specified.

Microsoft.AnalysisServices.Server s = new Microsoft.AnalysisServices.Server();

s.Connect("Provider=MSOLAP.3;Password=123;Persist Security Info=True;User ID=domain\username;Data Source=<server ip>;Initial Catalog=<analysis DB>");

Is this possible?

Note that if we are using the OLEDB 9.0 provider for Analysis Services to connect an excel sheet to the analysis database we can easily specify the user name and password, so is there a similar way to do the same from a .Net application?

Any feedback is appreciated, thanks,

Grace

If you want to use a Windows Indentity, then you can′t. For other connection options refer to the connection properties which are shown e.g. here:

http://www.ssas-info.com/ssas_articles/ssas_articles/analysis_services_2000_and_2005_connection_string_properties.html


Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

Thanks Jens,

The link helped a lot. We were able to connect using specific Roles and that is what we were looking for exactly but didn't know it exists.

Grace

Monday, 19 March 2012

Connect SQL database through ASP

I have SQL Server 2000 installed on my machine and tried
to develop asp script to connect to the server database
(localhost). But I got invalid authorization error
message, any help will be greatly appreciated. Following
is my script:
<%Option Explicit%>
<html>
<head>
<title>Testing Connection1</title>
</head>
<body>
<%
Dim strConnectionString
strConnectionString = "Provider=SQLOLEDB.1;Data
Source=C:\Program Files\Microsoft SQL
Server\MSSQL\Data\Master.mdf"
Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")
objConn.Open strConnectionString
strSQL = "SELECT First_Name, Last_Name FROM
Member_Master"
objRS.Open strSQL, objConn
Set objFirstName = objRS("First_Name")
Set objLastName = objRS("Last_Name")
Do Until objRS.EOF
Response.Write objFirstName & " " & objLastName
& "<BR>"
objRS.MoveNext
Loop
objRS.Close
objConn.Close
Set objRS = Nothing
Set objConn = Nothing
%>
</body>
</html>
Thanks,
Sheridan
You have to set the DataSource in the connection string to the Server name,
not the operating system file name.
Dim strConnectionString
strConnectionString = "Provider=SQLOLEDB.1;Data Source=(local)"
Should work, although it is better to replace (local) with the actual name
of the SQL Server (which should be the same as your computername if you have
a default installation).
Jacco Schalkwijk
SQL Server MVP
"Sheridan" <anonymous@.discussions.microsoft.com> wrote in message
news:25c0b01c46111$a9a8d950$a401280a@.phx.gbl...
> I have SQL Server 2000 installed on my machine and tried
> to develop asp script to connect to the server database
> (localhost). But I got invalid authorization error
> message, any help will be greatly appreciated. Following
> is my script:
> <%Option Explicit%>
> <html>
> <head>
> <title>Testing Connection1</title>
> </head>
> <body>
> <%
> Dim strConnectionString
> strConnectionString = "Provider=SQLOLEDB.1;Data
> Source=C:\Program Files\Microsoft SQL
> Server\MSSQL\Data\Master.mdf"
> Dim objConn, objRS
> Set objConn = Server.CreateObject("ADODB.Connection")
> Set objRS = Server.CreateObject("ADODB.Recordset")
> objConn.Open strConnectionString
> strSQL = "SELECT First_Name, Last_Name FROM
> Member_Master"
> objRS.Open strSQL, objConn
> Set objFirstName = objRS("First_Name")
> Set objLastName = objRS("Last_Name")
> Do Until objRS.EOF
> Response.Write objFirstName & " " & objLastName
> & "<BR>"
> objRS.MoveNext
> Loop
> objRS.Close
> objConn.Close
> Set objRS = Nothing
> Set objConn = Nothing
> %>
> </body>
> </html>
> --
> Thanks,
> Sheridan

Connect SQL database through ASP

I have SQL Server 2000 installed on my machine and tried
to develop asp script to connect to the server database
(localhost). But I got invalid authorization error
message, any help will be greatly appreciated. Following
is my script:
<%Option Explicit%>
<html>
<head>
<title>Testing Connection1</title>
</head>
<body>
<%
Dim strConnectionString
strConnectionString = "Provider=SQLOLEDB.1;Data
Source=C:\Program Files\Microsoft SQL
Server\MSSQL\Data\Master.mdf"
Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")
objConn.Open strConnectionString
strSQL = "SELECT First_Name, Last_Name FROM
Member_Master"
objRS.Open strSQL, objConn
Set objFirstName = objRS("First_Name")
Set objLastName = objRS("Last_Name")
Do Until objRS.EOF
Response.Write objFirstName & " " & objLastName
& "<BR>"
objRS.MoveNext
Loop
objRS.Close
objConn.Close
Set objRS = Nothing
Set objConn = Nothing
%>
</body>
</html>
--
Thanks,
SheridanYou have to set the DataSource in the connection string to the Server name,
not the operating system file name.
Dim strConnectionString
strConnectionString = "Provider=SQLOLEDB.1;Data Source=(local)"
Should work, although it is better to replace (local) with the actual name
of the SQL Server (which should be the same as your computername if you have
a default installation).
Jacco Schalkwijk
SQL Server MVP
"Sheridan" <anonymous@.discussions.microsoft.com> wrote in message
news:25c0b01c46111$a9a8d950$a401280a@.phx
.gbl...
> I have SQL Server 2000 installed on my machine and tried
> to develop asp script to connect to the server database
> (localhost). But I got invalid authorization error
> message, any help will be greatly appreciated. Following
> is my script:
> <%Option Explicit%>
> <html>
> <head>
> <title>Testing Connection1</title>
> </head>
> <body>
> <%
> Dim strConnectionString
> strConnectionString = "Provider=SQLOLEDB.1;Data
> Source=C:\Program Files\Microsoft SQL
> Server\MSSQL\Data\Master.mdf"
> Dim objConn, objRS
> Set objConn = Server.CreateObject("ADODB.Connection")
> Set objRS = Server.CreateObject("ADODB.Recordset")
> objConn.Open strConnectionString
> strSQL = "SELECT First_Name, Last_Name FROM
> Member_Master"
> objRS.Open strSQL, objConn
> Set objFirstName = objRS("First_Name")
> Set objLastName = objRS("Last_Name")
> Do Until objRS.EOF
> Response.Write objFirstName & " " & objLastName
> & "<BR>"
> objRS.MoveNext
> Loop
> objRS.Close
> objConn.Close
> Set objRS = Nothing
> Set objConn = Nothing
> %>
> </body>
> </html>
> --
> Thanks,
> Sheridan

Sunday, 11 March 2012

Connect from WIN2000 TO WINNT/SQL2000 using WIndows authentication

Hello,

we develop on Powerbuilder 7.03. We want to use WIndows authentication to connect to a SQL server 2000 with WIN NT 4.0. as OS.
When I want to connect from my PC WIN2000 to SQL2000 with WINNT operating system, I can't ( login failed ).
but when I connect to my PC win2000 to a sql server 2000 with WIN 2000 OS, the connection goes well. ??
Someone encountered the same problem ?? and found a solution ??

Any help will be appreciate.
Thanks in advance.Try this - talks about Windows NT and SQL Server Security

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/modadmin/html/deconwindowsntsqlserverlogins.asp|||Originally posted by ascollins
Try this - talks about Windows NT and SQL Server Security

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/modadmin/html/deconwindowsntsqlserverlogins.asp

Thanks for your reply.
My connection from NT to WIN2000/SQL SRV2000 is OK. my problem is I can't connect from WIN2000 to WIN2000/SQL SRV2000 using windows authentication with PowerBuilder 7.03.

Tuesday, 14 February 2012

Configuring SQL

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.googlegro ups.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:[vbcol=seagreen]
> 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:

Configuring SQL

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:[vbcol=seagreen]
> 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...|||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:
>|||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:[vbcol=seagreen]
> 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. Y
ou
> may also want to look at using SMO.
> John
> "Eng.Rana@.gmail.com" wrote:
>|||thanx
but isn't there any other way to do the same job'
Uri Dimant wrote:[vbcol=seagreen]
> 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...|||Have a .sql file containing the commands, which you kick off using SQLCMD.EX
E 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:
>|||thanx Tibor
what if i want to take an exteranl args from users like the new sa
password for example
Tibor Karaszi wrote:[vbcol=seagreen]
> 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@.f16g20
00cwb.googlegroups.com...|||> 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 ap
p 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.c
om...
> thanx Tibor
> what if i want to take an exteranl args from users like the new sa
> password for example
> Tibor Karaszi wrote:
>

Configuring SQL

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'?
>> >> >> >
>> >> >
>> >
>

Configuring SQL

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 you considered using the Script-Task in the SSIS-package? AFAIK you
can access all functions there and write your Script in VB.NET code.

--
Benedikt Ries
----------------------
Benedikt Ries's Profile: http://www.dbtalk.net/m1098
View this thread: http://www.dbtalk.net/t345220|||Thanx Benedikt :),
plz note i'm using SQL server 2000

any other ideas??

Benedikt Ries wrote:

Quote:

Originally Posted by

Have you considered using the Script-Task in the SSIS-package? AFAIK you
can access all functions there and write your Script in VB.NET code.
>
>
--
Benedikt Ries
----------------------
Benedikt Ries's Profile: http://www.dbtalk.net/m1098
View this thread: http://www.dbtalk.net/t345220

|||Create a batch file that will use OSQL or ISQL, and run all script you
want.
something like :

SET SERVERNAME=XYZ
SET DBNAME=ABC
SET USERNAME=ABC
SET PSW=ABC

ISQLW -U%USERNAME% -P%PSW% -S%SERVERNAME% -d%DBNAME%
-ic:\temp\script1.SQL -oLOGFILE.LOG -FA -n
TYPE LOGFILE.LOG >FULLLOG.LOG

ISQLW -U%USERNAME% -P%PSW% -S%SERVERNAME% -d%DBNAME%
-ic:\temp\script3.SQL -oLOGFILE.LOG -FA -n
TYPE LOGFILE.LOG >FULLLOG.LOG

Eng.Rana@.gmail.com wrote:

Quote:

Originally Posted by

Thanx Benedikt :),
plz note i'm using SQL server 2000
>
any other ideas??
>
>
Benedikt Ries wrote:

Quote:

Originally Posted by

Have you considered using the Script-Task in the SSIS-package? AFAIK you
can access all functions there and write your Script in VB.NET code.

--
Benedikt Ries
----------------------
Benedikt Ries's Profile: http://www.dbtalk.net/m1098
View this thread: http://www.dbtalk.net/t345220

Friday, 10 February 2012

Configure SSIS package

I would like to develop a SSIS package where in there are 'X' number of input data sources like flat files, MS Access mdb files etc. The details about the number of input data sources, type of each data sources, the physical path of the data file, name os database server, username for the database server, password for the database server etc has to come from the configuration file.

Can anyone help on this ?

While you can use configurations to set things like database connections, user names, etc, SSIS packages can't change the metadata used in a dataflow at runtime. They aren't self-modifying. If you are trying to build a "generic" package that can handle any data dynamically, you will need to build an application that creates the package on the fly. SSIS has a good API, so this is certainly in the realm of possiblity, but it is still a lot of work.