Thursday, February 11, 2010

Some basics in SQL Server

SET ROWCOUNT 1000
SET NOCOUNT ON

Randomly taking records from a table
Select empname, newID() Randomcol from emp where empid=1 order by newID()

@@Rowcount – is used to find number of rows effected by a sql statement
Select @@Rowcount AS rowcount

No comments:

Post a Comment