You can sort a Table Randomly with a single keyword.
the newsid() is the keyword which generates a random number in sql server.
Here is small ex.
1)Create a database
2)Create Table Master
3)Create Fields Code nvarchar(50), Name Nvarchar(50)
4)Enter some data into table
5)Now open new query window
6)Write sql
7)Select * from Master Order by newid()
Now, run this code it will return data in random format.
You can also use newid() to generate a unique number or a number like verification code etc.
for ex.
Select newid()
Randomly Sort Sql server Table
An IT Solution is a purpose and value-driven organization where everyone is empowered to take decisions in line with our culture. We provide a unique environment of freedom, flexibility & trust that allows an individuals potentials to flower; this results in tremendous growth opportunities.Such a culture, naturally, appeals to everyone. We listen, we think and we act. The IT field is all about thought leadership. We invest in thought for you as customers
No comments:
Post a Comment