Sunday, March 25, 2012

Exporting Diagram

Hi,
How can i export diagram from one database to another database ?Hi
Try:
http://support.microsoft.com/defaul...kb;en-us;320125
John
"DMP" wrote:

> Hi,
> How can i export diagram from one database to another database ?
>
>|||I wrote a System Stored Proc for that... If you put this in Master Dataabse,
it will be available from any Database...
Create Procedure dbo.sp_MoveDiagram
@.DiagGramName VarChar(255),
@.SourceDB VarChar(255),
@.DestDB VarChar(255)
As
Set NoCount On
Declare @.NL nChar(2) Set @.NL = Char(13) + Char(10)
Declare @.Sql nVarChar(3000)
Set @.Sql = 'Set Identity_Insert ' +
@.DestDB + '..dtproperties On ' + @.NL
-- ---
Set @.Sql = @.Sql + ' Insert ' + @.DestDB +
'..dtproperties(id,objectid,property,' +
'value,lvalue,uvalue,version)' +
'Select id,objectid,property,value,' +
'lvalue,uvalue,version From ' +
@.SourceDB + '..dtproperties Where ' +
@.SourceDB + '..dtproperties.objectID = ' +
'(Select ObjectID From ' + @.SourceDB +
'..dtproperties Where Property = ''DtgSchemaNAME''' +
'And Value = ''' + @.DiagGramName + ''')' + @.NL
-- ---
Set @.Sql = @.Sql + 'Set Identity_Insert ' +
@.DestDB + '..dtproperties Off'
--Select @.Sql Sql
Exec sp_ExecuteSql @.Sql
-- ---
Return(0)
-- ----
"DMP" wrote:

> Hi,
> How can i export diagram from one database to another database ?
>
>|||Thanks for reply,
can i move a stored procedure through user SP ?
"CBretana" <cbretana@.areteIndNOSPAM.com> wrote in message
news:7B8E66E2-4B32-4B51-BD34-66009A36DA15@.microsoft.com...
>I wrote a System Stored Proc for that... If you put this in Master
>Dataabse,
> it will be available from any Database...
> Create Procedure dbo.sp_MoveDiagram
> @.DiagGramName VarChar(255),
> @.SourceDB VarChar(255),
> @.DestDB VarChar(255)
> As
> Set NoCount On
> Declare @.NL nChar(2) Set @.NL = Char(13) + Char(10)
> Declare @.Sql nVarChar(3000)
>
> Set @.Sql = 'Set Identity_Insert ' +
> @.DestDB + '..dtproperties On ' + @.NL
> -- ---
> Set @.Sql = @.Sql + ' Insert ' + @.DestDB +
> '..dtproperties(id,objectid,property,' +
> 'value,lvalue,uvalue,version)' +
> 'Select id,objectid,property,value,' +
> 'lvalue,uvalue,version From ' +
> @.SourceDB + '..dtproperties Where ' +
> @.SourceDB + '..dtproperties.objectID = ' +
> '(Select ObjectID From ' + @.SourceDB +
> '..dtproperties Where Property = ''DtgSchemaNAME''' +
> 'And Value = ''' + @.DiagGramName + ''')' + @.NL
> -- ---
> Set @.Sql = @.Sql + 'Set Identity_Insert ' +
> @.DestDB + '..dtproperties Off'
> --Select @.Sql Sql
> Exec sp_ExecuteSql @.Sql
> -- ---
> Return(0)
> -- ----
>
> "DMP" wrote:
>

No comments:

Post a Comment