Export SQL Server database diagram,
I know that some of you might want to do like me, export database diagram to be executed in other server. This case would meet when we want to have a very blank database but remain all database schema of an existing database one. Normally we can do a back up then restore it as a new name then run the script to truncate all data in every tables but it will be difficult if it was build with diagram. I have found on the net the sample on SQL Server 2000 and also 2005. It is a very helpfull for my case as I need to re-create database schemas on my new blank database. 1. SQL 2000 There have 2 store procedures and a function is needed ufn_VarbinaryToVarcharHex CREATE FUNCTION dbo.ufn_VarbinaryToVarcharHex (@VarbinaryValue varbinary(4000)) RETURNS Varchar(8000) AS BEGIN Declare @NumberOfBytes Int Declare @LeftByte Int Declare @RightByte Int SET @NumberOfBytes = datalength(@VarbinaryValue) IF (@NumberOfBytes > 4) RETURN Payment.dbo.ufn_VarbinaryToVarc...