Showing posts with label MsSQL. Show all posts
Showing posts with label MsSQL. Show all posts

Wednesday, January 8, 2014

Sql Server get Date String

this is for example you have to change char("number") ;


select CONVERT(CHAR(8),GETDATE(),112) = 20140108
select CONVERT(CHAR(16),GETDATE(),110) = 01-08-2014    
select CONVERT(CHAR(16),GETDATE(),111) = 2014/01/08    


select CONVERT(CHAR(30),GETDATE(),100) = 01  8 2014  6:06PM      
select CONVERT(CHAR(30),GETDATE(),101) = 01/08/2014                        
select CONVERT(CHAR(30),GETDATE(),102) = 2014.01.08                  
select CONVERT(CHAR(30),GETDATE(),105) = 08-01-2014                  

Tuesday, September 10, 2013

Query time Count

you can fine result millisecond

DECLARE @start_time DATETIME, @end_time DATETIME
SET @start_time = CURRENT_TIMESTAMP;


[your Query here]


SET @end_time = CURRENT_TIMESTAMP
SELECT DATEDIFF(ms, @start_time, @end_time),DATEDIFF(ms, @start_time, @end_time)/1000;

Thursday, July 4, 2013

autoCommit off in mssql 2008

if you you use this tool Microsoft SQL Server Management Studio

follow this step

1. tool -> option -> query execute -> sql server -> ANSI -> SET Implicity_transactions check

important thing is open new Query Tap