April, 2010 Archives

22
Apr

Howto: Move table data between databases

by Mikael Lundin in Programming

Working in different environments – development, test, staging, production often makes you create data in one database and have the need to move it to another. This is actually quite easy to do with T-SQL.

-- Move users created in developmentdb to testdb
BEGIN TRANSACTION
  -- Enable identity insert if you need to insert the same PK
  SET IDENTITY_INSERT [testdb].[dbo].[user] ON

  INSERT INTO [testdb].[dbo].[user] ([id], [name], [password], [email])
	SELECT [id], [name], [password], [email]
		FROM [developmentdb].[dbo].[user]
		WHERE [id] IN ('753010', '753011', '753012', '753013')

  SET IDENTITY_INSERT [testdb].[dbo].[user] OFF
COMMIT TRANSACTION
9
Apr

CSS Naked Day

by Mikael Lundin in Other

Today is CSS Naked Day and I celebrate this by stripping my blog from styles.

  • The idea behind this event is to promote Web Standards. Plain and simple. This includes proper use of (x)html, semantic markup, a good hierarchy structure, and of course, a good ‘ol play on words. It’s time to show off your .Dustin Diaz – CSS Naked Day

Inspired by Lillbra.se