Copy database diagram from one DB to another DB
insert into newdb.dbo.sysdiagrams select name, principal_id,[version], [definition] from olddb.dbo.sysdiagrams
Blog comprises different TSQL solutons and useful ways to optimize our database and queries.
Wednesday, April 29, 2009
Tuesday, April 14, 2009
Query to retrieve stored procedures and views for a particular text
select so.id,so.name,so.xtype, sc.text from syscomments sc
inner join sysobjects so on so.id = sc.id
where sc.text like '%select *%'
and so.xtype in('P','V')
Subscribe to:
Posts (Atom)