How can I change owner of all tables and stored procedures in my database?
I know with executing stored procedure sp_changeobjectowner I can do it , but I don`t want to execute it for each table and sp,
Thx for your help
modified on Wednesday, January 02, 2008 5:20:30 AM
Does your database have any data in it? If not, you could always just generate the create script for your database and then change the owners using a global search and replace. There are other ways, but this is the easiest.
Deja View - the feeling that you've seen this post before.
Hi guys i need ur help in query...,
If any one knows plz hep mw with query,
See i have 2 tables like this:
Key Id name
1 100 Mag
2 101 Kum Table2:
Id M1 M2
100 50 50
101 60 55
Now i want to that table1 "kum" Id want to 100 & "Mag" Id want to 101..,
So i want to do update the records using key in table1...,
While updating the table1 id and name..,
The changes have to update in Table2 records also (Id,m1,m2)...,
In this case if i update it will affect the both record in same table itself...,
so i need proper updation, How to do that?
Thanks & Regards,
please don't forget to vote on the post
modified on Wednesday, January 02, 2008 7:21:51 AM
While SQL Server will generally order by the primary key, this cannot be relied on. If it sees an optimisation that results in a different sequence it will use that. However, you can override the final output by using the ORDER BY clause.