Click here to Skip to main content
15,902,492 members
Home / Discussions / Database
   

Database

 
AnswerRe: DateTime Conversion!!! [modified] Pin
Frank Kerrigan8-Aug-06 1:05
Frank Kerrigan8-Aug-06 1:05 
AnswerRe: DateTime Conversion!!! [modified] Pin
Mike Dimmick8-Aug-06 2:48
Mike Dimmick8-Aug-06 2:48 
Questionrandom row Pin
md_refay7-Aug-06 19:31
md_refay7-Aug-06 19:31 
AnswerRe: random row Pin
_AK_7-Aug-06 19:54
_AK_7-Aug-06 19:54 
GeneralRe: random row Pin
Colin Angus Mackay7-Aug-06 22:05
Colin Angus Mackay7-Aug-06 22:05 
GeneralRe: random row Pin
_AK_7-Aug-06 22:22
_AK_7-Aug-06 22:22 
AnswerRe: random row Pin
albCode7-Aug-06 21:15
albCode7-Aug-06 21:15 
AnswerRe: random row Pin
Eric Dahlvang8-Aug-06 3:56
Eric Dahlvang8-Aug-06 3:56 
Make as stored procedure:
CREATE PROCEDURE GetRandomRow AS

declare @nRand int
declare @cSQL varchar(200)

select @nRand = 1 + (rand() * (select count(*) from MyTestTable))

select @cSQL = 'SELECT TOP 1 * FROM (SELECT TOP ' + cast(@nRand as varchar) 
  + ' * FROM MyTestTable ORDER BY IDColumn ASC) as tbl ORDER BY IDColumn DESC'

exec(@cSQL)

You could send in the table name and ORDER BY field as parameters.


--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters

QuestionWhat would you solve the is scenario [modified] Pin
Skanless7-Aug-06 18:41
Skanless7-Aug-06 18:41 
AnswerRe: What would you solve the is scenario Pin
Frank Kerrigan8-Aug-06 2:43
Frank Kerrigan8-Aug-06 2:43 
QuestionUpdating a dataset from a datagrid Pin
TheJudeDude7-Aug-06 10:25
TheJudeDude7-Aug-06 10:25 
AnswerRe: Updating a dataset from a datagrid Pin
Frank Kerrigan8-Aug-06 1:10
Frank Kerrigan8-Aug-06 1:10 
GeneralRe: Updating a dataset from a datagrid Pin
TheJudeDude8-Aug-06 6:24
TheJudeDude8-Aug-06 6:24 
QuestionSQL Query Order of Execution Pin
Rajkamal_dfine7-Aug-06 3:36
Rajkamal_dfine7-Aug-06 3:36 
AnswerRe: SQL Query Order of Execution Pin
Colin Angus Mackay7-Aug-06 3:54
Colin Angus Mackay7-Aug-06 3:54 
AnswerRe: SQL Query Order of Execution Pin
Ennis Ray Lynch, Jr.7-Aug-06 10:08
Ennis Ray Lynch, Jr.7-Aug-06 10:08 
QuestionDiffucult T-SQL question: showing sales data that was not sold Pin
Izak -7-Aug-06 0:29
Izak -7-Aug-06 0:29 
AnswerRe: Diffucult T-SQL question: showing sales data that was not sold Pin
Eric Dahlvang7-Aug-06 3:41
Eric Dahlvang7-Aug-06 3:41 
GeneralRe: Diffucult T-SQL question: showing sales data that was not sold Pin
Izak -7-Aug-06 23:14
Izak -7-Aug-06 23:14 
GeneralRe: Diffucult T-SQL question: showing sales data that was not sold Pin
Eric Dahlvang8-Aug-06 3:09
Eric Dahlvang8-Aug-06 3:09 
QuestionMSDE Bootrappers Pin
JacquesDP6-Aug-06 23:46
JacquesDP6-Aug-06 23:46 
AnswerRe: MSDE Bootrappers Pin
Suresh Kumar.A13-Aug-06 1:36
Suresh Kumar.A13-Aug-06 1:36 
QuestionNHibernate? Pin
YOMATA6-Aug-06 22:34
YOMATA6-Aug-06 22:34 
QuestionTree View Menu in HTML Pin
skysunil6-Aug-06 20:59
skysunil6-Aug-06 20:59 
AnswerRe: Tree View Menu in HTML Pin
Colin Angus Mackay6-Aug-06 22:16
Colin Angus Mackay6-Aug-06 22:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.