sp_removedbreplication
This takes a few minutes for my database, which has about 20-30 million rows on 3o or 40 tables. You'll then also want to remove replication constraints, which do not seem to be removed, unfortunately, when you issue the above command. Use this script:
declare @table nvarchar(500), @constraint nvarchar(500), @sql nvarchar(500), @t_catalog nvarchar(500), @t_schema nvarchar(500), @i integer
select
table_name,
constraint_name,
table_catalog,
table_schema
into #IdentityConstraints
from information_schema.table_constraints
where constraint_name like 'repl_identity_range_sub_%'
select @i = (select count(*) from #IdentityConstraints)
while @i > 0
begin
select top 1
@table='['+table_catalog+'].['+table_schema+'].['+table_name+']',
@constraint=constraint_name
from #IdentityConstraints
set @sql = N'alter table '+@table+' drop constraint ['+@constraint+']'
exec sp_executesql @sql
print 'Dropped:'+@constraint+' table:'+@table
delete from #IdentityConstraints where constraint_name=@constraint
select @i = @i - 1
end
drop table #IdentityConstraints
On a completely different topic, check out this neat lifehack.org article:
http://www.lifehack.org/articles/lifehack/how-to-become-a-creative-genius.html
Before you go out making mind maps, be sure and read:
http://en.wikipedia.org/wiki/Mind_map
I'm not saying I'm a creative genius, but it is nice to know that I'm not wasting my time with all of these weird habits I've had since childhood. They forgot one thing though:
Legos, etc...
Parents: Buy your kid legos. There is no need for the expensive name-brand stuff. They are more of a cheap advertising gimmick now. Get large quantities of the knock-off stuff. Optionally, you may also remove all of the TVs in the house. If your kid doesn't like legos, tell them that they're not "old enough" and it's for "big kids only". That should jump-start things. I don't know why but my earliest memories are of hours and hours spent in quiet solitude, tinkering with my legos. I no longer own legos (read: I have a little brother.), but they lead me to discover the joy of creation which I still pursue.
0 comments:
Post a Comment