Theoretically this is random as well:<br />Select * from Table<br /><br />However it will ususally give the same "random" result every time [<img src='/community/emoticons/emotion-1.gif' alt='' />]
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by rockmoose</i><br /><br />Theoretically this is random as well:<br />Select * from Table<br /><br />However it will ususally give the same "random" result every time [<img src='/community/emoticons/emotion-1.gif' alt='' />]<br /><hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote"><br /><br />rockmoose, nice to see you here [<img src='/community/emoticons/emotion-1.gif' alt='' />]<br /><br /><br /><br />Madhivanan<br /><br />Failing to plan is Planning to fail
Note that newid() is not really random on NT4 since it use a part of the MAC address for key generation or something. You will end up with same result most of the time. It might have been fixed in one of the later servie packs. But in theory noone should be using NT anymore [<img src='/community/emoticons/emotion-2.gif' alt='' />]
Is your question related to NEWID()? Or are you looking for something like this? CREATE TABLE cmdshell (line VARCHAR(260)) GO INSERT INTO cmdshell EXEC master.dbo.xp_cmdshell 'dir c: /B' SELECT * FROM cmdshell DROP TABLE cmdshell -- Frank Kalis Microsoft SQL Server MVP http://www.insidesql.de Ich unterstütze PASS Deutschland e.V. http://www.sqlpass.de)
>>how to use execute to insert in the table<br /><br />It is always better to start a new topic than asking in other topic as your question does not seem to be related with this topic [<img src='/community/emoticons/emotion-1.gif' alt='' />]<br /><br /><br />Madhivanan<br /><br />Failing to plan is Planning to fail