Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
smhjm
Starting Member
3 Posts |
Posted - 2005-12-25 : 05:53:40
|
| Hi my friendI want Generate the script of my table but when in normal form doing this sqlserver generate my script with [dbo].nameOfObject for example:if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_EOSBuOfficeUnitT_EOSBuUnitT]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)ALTER TABLE [dbo].[EOSBuOfficeUnitT] DROP CONSTRAINT FK_EOSBuOfficeUnitT_EOSBuUnitTGOif exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[EOSBuUnitT]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)drop table [dbo].[EOSBuUnitT]GOCREATE TABLE [dbo].[EOSBuUnitT] ( [UnID] [int] IDENTITY (1, 1) NOT NULL , [ModuleID] [int] NULL , [UnName] [nvarchar] (100) COLLATE Arabic_CI_AS NULL , [UnManager] [nvarchar] (100) COLLATE Arabic_CI_AS NULL , [UnParent] [nvarchar] (50) COLLATE Arabic_CI_AS NULL ) ON [PRIMARY]GOALTER TABLE [dbo].[EOSBuUnitT] WITH NOCHECK ADD CONSTRAINT [PK_Unit] PRIMARY KEY CLUSTERED ( [UnID] ) ON [PRIMARY] GObut i want generate my Scrip with replace [dbo.] with {DataBaseOwner} and i don't know where is {ObjectQulifier}can you help to me that generate my script with this namefor example:if exists (select * from dbo.sysobjects where id = object_id(N'{DataBaseOwner}{ObjectQulifier}EOSBuUnitT') and OBJECTPROPERTY(id, N'IsUserTable') = 1)drop table {DataBaseOwner}{ObjectQulifier}EOSBuUnitTGO |
|
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2005-12-25 : 13:27:40
|
| hello,Why not EM generate the script for you, then you can choose to alter what you desireAfrika |
 |
|
|
|
|
|