Friday, March 23, 2012
how to change dts owner name
does anyone know how to change a dts packeage's owner name
on sql 2000?
we have individuals that creates dts packages on
production servers, and we would like to change the dts
owner name from the individual accounts into server's own
account name.
many thanks!
JJ
sp_changeobjectowner
I've never had to change a dts owner, but this is where I would look first.
John
"JJ Wang" wrote:
> hi,
> does anyone know how to change a dts packeage's owner name
> on sql 2000?
> we have individuals that creates dts packages on
> production servers, and we would like to change the dts
> owner name from the individual accounts into server's own
> account name.
> many thanks!
> JJ
>
|||Check out http://www.sqldts.com/default.aspx?212.
Hope this helps.
Dan Guzman
SQL Server MVP
"JJ Wang" <anonymous@.discussions.microsoft.com> wrote in message
news:03d001c4a74b$4ce490d0$a501280a@.phx.gbl...
> hi,
> does anyone know how to change a dts packeage's owner name
> on sql 2000?
> we have individuals that creates dts packages on
> production servers, and we would like to change the dts
> owner name from the individual accounts into server's own
> account name.
> many thanks!
> JJ
|||sp_changeobjectowner is intended for SQL Server database objects and can't
be used for DTS packages.
Hope this helps.
Dan Guzman
SQL Server MVP
"John Cappelletti" <JohnCappelletti@.discussions.microsoft.com> wrote in
message news:7D4B53C1-5AAD-42F5-A8FE-C1DB9DB37508@.microsoft.com...[vbcol=seagreen]
> sp_changeobjectowner
> I've never had to change a dts owner, but this is where I would look
> first.
> John
>
> "JJ Wang" wrote:
|||I use:
use msdb
go
sp_reassign_dtspackageowner [@.name =] 'name',
[@.id =] 'id',
[@.newloginname =] 'newloginname'
--to find dts package id :
use msdb
go
select * from sysdtspackages
go
"JJ Wang" wrote:
> hi,
> does anyone know how to change a dts packeage's owner name
> on sql 2000?
> we have individuals that creates dts packages on
> production servers, and we would like to change the dts
> owner name from the individual accounts into server's own
> account name.
> many thanks!
> JJ
>
how to change dts owner name
does anyone know how to change a dts packeage's owner name
on sql 2000?
we have individuals that creates dts packages on
production servers, and we would like to change the dts
owner name from the individual accounts into server's own
account name.
many thanks!
JJsp_changeobjectowner
I've never had to change a dts owner, but this is where I would look first.
John
"JJ Wang" wrote:
> hi,
> does anyone know how to change a dts packeage's owner name
> on sql 2000?
> we have individuals that creates dts packages on
> production servers, and we would like to change the dts
> owner name from the individual accounts into server's own
> account name.
> many thanks!
> JJ
>|||Check out http://www.sqldts.com/default.aspx?212.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"JJ Wang" <anonymous@.discussions.microsoft.com> wrote in message
news:03d001c4a74b$4ce490d0$a501280a@.phx.gbl...
> hi,
> does anyone know how to change a dts packeage's owner name
> on sql 2000?
> we have individuals that creates dts packages on
> production servers, and we would like to change the dts
> owner name from the individual accounts into server's own
> account name.
> many thanks!
> JJ|||sp_changeobjectowner is intended for SQL Server database objects and can't
be used for DTS packages.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"John Cappelletti" <JohnCappelletti@.discussions.microsoft.com> wrote in
message news:7D4B53C1-5AAD-42F5-A8FE-C1DB9DB37508@.microsoft.com...
> sp_changeobjectowner
> I've never had to change a dts owner, but this is where I would look
> first.
> John
>
> "JJ Wang" wrote:
>> hi,
>> does anyone know how to change a dts packeage's owner name
>> on sql 2000?
>> we have individuals that creates dts packages on
>> production servers, and we would like to change the dts
>> owner name from the individual accounts into server's own
>> account name.
>> many thanks!
>> JJ|||I use:
use msdb
go
sp_reassign_dtspackageowner [@.name =] 'name',
[@.id =] 'id',
[@.newloginname =] 'newloginname'
--to find dts package id :
use msdb
go
select * from sysdtspackages
go
"JJ Wang" wrote:
> hi,
> does anyone know how to change a dts packeage's owner name
> on sql 2000?
> we have individuals that creates dts packages on
> production servers, and we would like to change the dts
> owner name from the individual accounts into server's own
> account name.
> many thanks!
> JJ
>|||wow, thanks to you all for the quick response, tons of
good tips here. you solved my problem!!
thank you so much!!!!
JJ
>--Original Message--
>hi,
>does anyone know how to change a dts packeage's owner
name
>on sql 2000?
>we have individuals that creates dts packages on
>production servers, and we would like to change the dts
>owner name from the individual accounts into server's own
>account name.
>many thanks!
>JJ
>.
>
Friday, March 9, 2012
How to call a Store Procedure
I have a stored procedure that creates a normalized table from an existing denorm table. So I just need a simple way to call this SP from an aspx page. It would be good though to know how many records were effected, but this is not a requirement.
Pass the name of the stored procedure to a command object and set the CommandType to StoredProcedure. Then use ExecuteNonQuery to run it.
string query = "nameofsp";
string connect = "connectionstring";
using (SqlConnection conn = new SqlConnection(connect))
{
using (SqlCommand cmd = new SqlCommand(query, conn))
{
cmd.CommandType = CommandType.StoredProcedure;
conn.Open();
cmd.ExecuteNonQuery();
}
}
|||
Thanks for the quick reply.
I should have mentioned I'm building the apsx page with vb. How different will that look from the above?
Also, I have a DTS package that I have scheduled to run every week. But it appears I need to allow the user to also kick that off as needed. Can I use the above to call that? Or do I need to first create a SP that calls the DTS package?
Thanks!
|||Dim dbobj as new SQLConnection(connection_string_here)
dbobj.open()
Dim objCmd as new SQLCommand(sp_name_here, dbobj)
objCmd.CommandType = CommandType.StoredProcedure
objCmd.Parameters.Add("@.Param_Name_Here", Param_Value_Here) 'if any
objCmd.ExecuteNonQuery() 'Use ExecuteScalar if you want to return a single value
objCmd.Dispose()
dbobj.Close()
I would create the procedure first to run the DTS and call it as above.
|||
tomhirt:
I should have mentioned I'm building the apsx page with vb.
That would have been helpful, but not particularly necessary if you just copy and paste the C# code I gave into www.codechanger.com
tomhirt:
How different will that look from the above?
Almost the same:
Dim query As String = "nameofsp"
Dim connect As String = "connectionstring"
Using conn As New SqlConnection(connect)
Using cmd As New SqlCommand(query, conn)
cmd.CommandType = CommandType.StoredProcedure
conn.Open()
cmd.ExecuteNonQuery()
End Using
End Using
I tend to use Using statements for objects that need to be closed and disposed. Saves me remembering to have to do it explicitly each time.
tomhirt:
Also, I have a DTS package that I have scheduled to run every week. But it appears I need to allow the user to also kick that off as needed. Can I use the above to call that? Or do I need to first create a SP that calls the DTS package?
Thanks!
Like Rich said.
|||Excellent. I did not know I could use something like Code changer. Great refernce.