.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Select random 10 records in sql server 2005 in terms of time

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :ASP.Net
Hello,i have a query that select random records in access database in terms of time : "SELECT TOP 10 * FROM Tbl ORDER BY Rnd(-10000000*TimeValue(Now())*[ID])"now i wish to convert this query for using in sql server 2005 such that return random records in term of time 

View Complete Post

More Related Resource Links

SELECT Random Records in term of time



I want to return random records in term of time whithout NEWID

What is fastest way of reading large size XML in SQL Server 2005 using Select statement ?

What is fastest way of reading large size XML in SQL Server 2005 using Select statement ?

Max Idle Time for a Connection in SQL Server 2005


Can you please let me know where I can set the MAX IDLE TIME for the SQL SERVER CONNECTION.

IS this the value set for the KEEp Alive propoerty in the sql server configuration Manager.


select query sql server 2005


i have three table

1)    tbl_pages              primary key column is  (intPk_PageID)

2)   tbl_pagecontents   foreign key colum (intPk_PageContentID) reference with tbl_pages

3)   tbl_banners           foreign key colum  (intFk_pageid) reference with tbl_pages

select * from tbl_pages
intPk_PageID   vcr_PageTitle    vcr_PageUrl         int_PageStatus
1                      Contact Us          contactus.aspx             1
2                      News                   news.aspx       

SQL Server 2005 random login failures for windows forms application


One of our VS .NET 2008 windows forms applications runs from multiple client machines. The application randomly has login failures from random machines and from random places in the code. The login works almost every time but about once every fifteen minutes an error shows up in SQL Server error logs from a random user. We are running a clustered SQL Server 2005 system and the database is in 2005 (90) mode.

The following error appears in the SQL Server error logs:

Login failed for 'App_Login'. [CLIENT: XXX.XXX.X.XXX] Error: 18456, Severity: 14, State: 16.

The following error is what the client sees:

SQL Server 2005 CPU use 100% and Connection Time Out



I have a thin C# application with SQL server 2005 standard Edition . Database size is 15GB . The server has 16 GB RAM and 2.6 Ghz Xeon processor, with 4 cores. Application has lot of stored procedures performs some calculations and transfer the data from one database named a to second database named b. Users can also get the reports from report database .

1: The application is much slow when it perform analysis (some calculations ) 

2: CPU usage goes to 100% and sometimes application crashes with this message.

timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

I have to optimize the application . I have found some duplicate non cluster indexes.

for example if i have primary key PK index (clustered) on the fields 1, 2 ,3

there  is another index which is non clustered on the same fields (1,2,3) 

there are around 10 to 15 tables with the same duplicate non clustered indexes.

I have few Questions :

How can i  configure the sql server 2005 to perform parallel executions of queries to utilize the all cores of CPU.

2: How can i know which query or store procedure is taking too much execution time and getting system resources.

3: How to know which index is fragmented&n

SQL Server 2005 - Maintenance Jobs take a long time after OS Upgrade


We have SQL 2005 Ent Edition (SP2) on W2k3 R2 Ent Edition. This OS was previously on Std Edtion and we had done an In-Place upgrade to Ent Edition some time back. Since then the Maintenance plans - Update Stas & Index Rebuild seem to take double the time to execute. I do believe this could be due to an already busy disk subsystem (RAID 5 array).

Can someone pls advice what could be possible reason for this sudden increase in the maintenance job execution time.

Paul - SQL DBA

Time out expired in SQL Server 2005


Hello to all

I am working in windows server 2008. In this i have installed SQL Server 2005. I made views (with 7-8 tables)in it. My database is around 40 GB. Now i am running my view but it is not running and giving error --

"  SQL Execution Error

Error Source :- .Net Sqlclient Data Provider

Error Message:- Time out expired. The timeout period elapsed prior to completion of the operation or the server is not responding "

Can anybody help me. It's very urgent. I am trying to solve this problem since last week but nothing could help.

I increase the execution time of SQL Server from going to Tools--> Options --> Query Execution Tab. But this doesnot work. I am thinking may be it is because of OS.

Can anybody help me out

Thanks in advance

Ritu Sharma

SQL Server 2005 Try and Catch Exception Handling

I'm pretty excited to see that there is some real error handling for T-SQL code in SQL Server 2005. It's pretty painful to have your wonderfully architected .NET solution tainted by less-than-VBScript error handling for stored procedures in the database. The big difference being the addition of TRY..CATCH blocks. Let's take a look:

Essential SQL Server Date, Time and DateTime Functions

The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any formatting considerations at all.

Date/Time Conversions Using SQL Server

There are many instances when dates and times don't show up at your doorstep in the format you'd like it to be, nor does the output of a query fit the needs of the people viewing it. One option is to format the data in the application itself. Another option is to use the built-in functions SQL Server provides to format the date string for you.

sql server 2000 vs 2005


i would like to ask what the difference between sql server 2000 and 2005 

How to save Unicode in SQL Server 2005

I am using google transliteration to display the text in Hindi/Tamil

I tried to store the text appear as Hindi from textarea in an nvarchar
field of database (SQL Server 2005) , the text saved as "???????".

After retireving text from the same it display the text as "???????".

Can anyone help me how to store and retrieve the actual data from SQL
Server 2005?

I am using ASP.net,VB.Net and SQL Server 2005

connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly.


I dont have the SQL EXPRESS installed instead I have SQL Standard Edition.

 I have two SQL Server instances installed.

 1- UserLT (this is sql 2000)
2- UserLT\SQL2005 (this is SQL 2005 named instance)

But when i try to add a database to my VS website project I get the following error:

Connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly. please verify the installation of the component or download from the URL: go.microsoft.com/fwlink/?linkId=4925

I went in Tools>Opetions>DataBase tools>Data Connection>Sql Server Instance Name (blank for default)

and changed the "SQLEXPRESS" to "USERLT\SQL2005".

But I still get the same error message. Any ideas how i can resolve this issue?

sql server 2005 enterprise edition is required


sql serve 2005 enterprise edition is required to work with microsoft enterprise blocks


need help: HTMLEditor, Sql-Server 2005 and CrystalReport


Hi All,
i use the Ajax Control Toolkit HTMLEditor in VS 2008 web-project and save the formated text/content in Sql-Server 2005 - it works fine!

Now, i want print the formated text in a Report, with CrystalReport...??? is this possible?

How do i handle the process? i thing, i see the forest based on all the trees not more...

Can anyone help me? how to do?


SQL Server 2005: Regular Expressions Make Pattern Matching And Data Extraction Easier


Now you can perform efficient, sophisticated text analysis using regular expressions in SQL Server 2005.

David Banister

MSDN Magazine February 2007

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend