Nov 26 2008

ADD IDENTITY TO COLUMN


Continue reading


Nov 23 2008

TraceMonkey and Javascript Engines Compared

One of the most impressive features in Google’s open source Chrome web browser is V8, a high-performance JavaScript virtual machine that was developed by a team of specialists in Denmark. Although Chrome’s performance beats the current stable version of Firefox, benchmarks show that Mozilla’s next-generation JavaScript engine actually outperforms V8.

Mozilla is using tracing optimization techniques and Adobe’s open source nanojit to increase the execution speed of SpiderMonkey, the JavaScript runtime engine in the Firefox web browser. The new engine, which is called TraceMonkey, delivers unprecedented JavaScript performance. The new optimizations have already landed in the latest Firefox nightly builds (but still have to be manually enabled) and will likely be included in Firefox 3.1.

Bellow as you can see are the SunSpider Javascript Results in FF, Chrome and IE7, IE8.
Continue reading


Nov 1 2008

Sql Server 2008 – New Features

If you work with SQL Server on a regular basis, either writing custom queries, designing databases, or optimizing queries, this is a must see video as it covers a number of the enhancements to SQL Server 2008 including:

- SQL Management Studio improvements including IntelliSense
- New Data Types for just dates or times (no more storing time when you only need the date)
- New Hierarchical data support .IsDescendent(), that can automatically pull a hierarchical view of data (no more custom recursive queries)
- New Grouping Sets statement which enables you to automatically group dimensions in a query for easy aggregation and reporting
- New Merge statement which provides automatic insert/update semantics for keeping multiple data sources in sync
- New FileStream attribute that enables you to include files that are stored in the server file system, but can be managed by SQL Server
- New data types and support for Geodata and geometry
- New support for optimizing “empty” or row/column tables using the sparse keyword


Nov 1 2008

Powerfull Paging with Stored Procedure

Lets consider a simple table called employee( emp_id, name, salary). Now, suppose that we need to create a gridview with paging. One option is to bring all the data from database and do the paging in client-side and another one is to do selective fetch. In both cases we can use a stored procedure that takes some parameter and returns a resultset.

Let’s see the following…

CREATE PROCEDURE GetEmployees
@Status int,
@StartIndex int,
@PageSize int
AS
WITH FilteredList( [emp_id],[name], [salary], [RowNumber])
AS
(
SELECT
[emp_id],
[name],
[salary],
ROW_NUMBER() OVER ( ORDER BY [ID] DESC) AS [RowNumber]

FROM
Employee
)

SELECT
*
FROM
FilteredList
WHERE
RowNumber BETWEEN (@StartIndex + 1) AND (@StartIndex + @PageSize)


Nov 1 2008

SQL SERVER – Reset sa Password

1.Open the SQL Server express management studio
2.Connect to SQL Server using windows authentication
3.Right click the server name and choose properties
4.Go to security tab. Change server authentication to “SQL Server and Windows Authentication mode”
5.Click OK and restart SQL Server
6.Go to SQL Server studio management express
7.Expand the server and choose security and expand logins
8.Right click on SA, from properties modify the password and confirm password

OR

To reset the sa password, you can make the following:
1. Login to the SQL Server box as the Administrator.
2. Run SQL Server Enterprise Manager.
3. Right-click the server name and choose ‘Edit SQL Server Registration properties’.
4. Choose ‘Use Windows authentication’ and click OK button.
5. Expand a server, expand a Security and click Logins.
6. Double-click the sa login and specify new password on the General tab. (enable Login to)

Or You Can Use


USE [master]
GO
ALTER LOGIN [sa] WITH DEFAULT_DATABASE=[master],
DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=ON, CHECK_POLICY=ON
GO
USE [master]
GO
ALTER LOGIN [sa] WITH PASSWORD=N’’ MUST_CHANGE
GO

or

From a command prompt

OSQL -S -E
EXEC sp_password NULL, ‘’, ’sa’
GO