mssql reset table identity
the following script resets the table identity seeding to 99, the next record will have identity of 100
DBCC CHECKIDENT ("[table name]", RESEED, 99);
GO
Achievement provides the only real pleasure in life
the following script resets the table identity seeding to 99, the next record will have identity of 100
DBCC CHECKIDENT ("[table name]", RESEED, 99);
GO
Posted by SF at 1:54 pm 0 comments
use master alter database DatabaseName set offline with rollback immediate
Posted by SF at 2:31 pm 0 comments
update Table1
SET StartDateTime = CONVERT(datetime,
CONVERT(VARCHAR(10),StartDateTime , 101)
+' '+CONVERT(VARCHAR,datepart(HH,NewStartTime))
+':'+CONVERT(VARCHAR,datepart(MI,NewStartTime))
+':'+CONVERT(VARCHAR,datepart(SS,NewStartTime))
+':'+CONVERT(VARCHAR,datepart(Ms,NewStartTime))
)
Posted by SF at 11:40 am 0 comments
I have 2 datetime values: StartDateTime ('11/01/2010 00:00:00') and NewStartTime('12/02/2010 09:30:00 AM'). I want to replace the time value in StartDateTime with the time value in NewStartTime. In order to achieve so I go:
DateTime NewStartDateTime = new DateTime(StartDateTime.Year, StartDateTime.Month, StartDateTime.Day, NewStartTime.Hour, NewStartTime.Minute, NewStartTime.Second);
Posted by SF at 3:56 pm 0 comments
this is caused by using "Request["xxx"]"
a quick fix is to use "HttpContext.Current.Request" instead
Posted by SF at 12:49 pm 0 comments