Skip to content

Instantly share code, notes, and snippets.

@ilovejs
Created September 3, 2014 01:05
Show Gist options
  • Save ilovejs/efad2f30bd53b40dcfac to your computer and use it in GitHub Desktop.
Save ilovejs/efad2f30bd53b40dcfac to your computer and use it in GitHub Desktop.
convert datetime type to int
SELECT * FROM [MZTEST].[dbo].[AccessToken]
use [mztest]
alter table AccessToken
add expireDateNew int
alter table AccessToken
drop column expireDate
exec sp_rename 'AccessToken.expireDateNew', 'expireDate'
update AccessToken
set expireDate = 86397
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment