RE: Dump database objects without owners

RE: Dump database objects without owners

 

  


You can create the script as DBO.<table name> since this is the safest
way to access the tables in a database, unless you want the owner of the
table to be the user who runs the script.


Sridhar Subba Rao
================




-----Original Message-----
From: labuk das [mailto:[Email Address Removed]
Sent: Tuesday, March 30, 2004 3:03 PM
To: LazyDBA.com Discussion
Subject: Dump database objects without owners


Dear Friends,

Sql Server 2000

While creating the database script using EM

right-click the database to script, point to All
Tasks, and then click Generate SQL Scripts.

This creates a script with owner of the objects, like
CREATE TABLE [usera].[tbl_wi_lookup] (
[wi_lookup_id] [int] IDENTITY (1, 1) NOT NULL ,
[wi_lookup_type] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[wi_lookup_value] [varchar] (100) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO

But i want to create a script without the user of the
object, because i want to run the scripts
under another user name. So that the owner of the
object will be changed. I want to get the
ddl of the database objects only (without the user
owning the object).

Is there a way to do it? Please shed some light.

Kumar


________________________________________________________________________
Yahoo! India Insurance Special: Be informed on the best policies,
services, tools and more.
Go to: http://in.insurance.yahoo.com/licspecial/index.html

---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY Get
today's cartoon: http://www.LazyDBA.com To unsubscribe, e-mail:
mssqldba-[Email Address Removed] For additional commands, e-mail:
mssqldba-[Email Address Removed] Notice

The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or [Email Address Removed] immediately
and destroy all copies of this message and any attachments.
MS Sql Server LazyDBA home page