What is the meaning of the following SQL Server declaration: datetime2(7)?

datetime2 [ (fractional seconds precision) ] It’s the fractional seconds precision according to the MSDN documentation. http://msdn.microsoft.com/en-us/library/bb677335.aspx This is the microsoft example of 4: DECLARE @datetime2 datetime2(4) = ’12-10-25 12:32:10.1234′; So I would assume that 7 would be: DECLARE @datetime2 datetime2(7) = ’12-10-25 12:32:10.1234567′;

what is logical reads in sql server? how to reduce no of logical?

From Microsoft SQL Server Documentation (Pages and Extents Architecture -> Reading Pages) has a good definition: The I/O from an instance of the SQL Server Database Engine includes logical and physical reads. A logical read occurs every time the Database Engine requests a page from the buffer cache. If the page is not currently in … Read more

How to get next value of SQL Server sequence in Entity Framework?

You can create a simple stored procedure in SQL Server that selects the next sequence value like this: CREATE PROCEDURE dbo.GetNextSequenceValue AS BEGIN SELECT NEXT VALUE FOR dbo.TestSequence; END and then you can import that stored procedure into your EDMX model in Entity Framework, and call that stored procedure and fetch the sequence value like … Read more

Calculation in Sql Server

Finally I achieved the result using below approach SELECT a.*, col3 – res AS Result FROM #TABLE1 a CROSS apply (SELECT Sum(b.col1 * Power(( 1 + b.COL2 / 100.00 ), new_rn)) AS res FROM (SELECT Row_number() OVER( partition BY ccp ORDER BY rno DESC) new_rn,* FROM #TABLE1 b WHERE a.ccp = b.ccp AND a.rno >= … Read more

Installing SQL Server 2012 – Error: Prior Visual Studio 2010 instances requiring update

I had this issue too, after following this guide, it was simply 1 additional patch that was required to get past the Rule “Prior Visual Studio 2010 instances requiring update.” failed. Was to locate this file, and patch my machine VS10sp1-KB983509.msp Simply do a file search on the installation media for SQL Server 2012, in … Read more