Viewing 6 posts - 721 through 726 (of 726 total)
SELECT
Result = Dateadd(dd,Round(((Rand() - .5) * 100),0),Getdate())
will deliver a random date somewhere between 50 days in the past and 50 in the future.
May 4, 2006 at 12:10 pm
While this thread was useful for you from the standpoint of understanding how to call udfs, you might want to look at the T-SQL GetUTCDate() function before you reinvent the...
May 4, 2006 at 7:20 am
As an aside, I actually looked at what your cursor is doing. Have you considered using the sadly undocumented sp_MSforeachtable stored procedure to see if it fits your needs?
It's not...
May 3, 2006 at 2:41 pm
I already noticed a minor bug. I joined the DECLARE AND SET for the @table variable. Just replace the line that says
DECLARE @table = 'pubs..sysobjects'
with
DECLARE @table varchar(50)
SET @table = 'pubs..sysobjects'
and...
May 3, 2006 at 2:21 pm
You can't use a variable directly in place of a table name in that SELECT statement. You can accomplish it by turning the select statement into a string, and performing...
May 3, 2006 at 2:18 pm
I have a question which should help us come up with an answer. In your example above, you wanted 3 and 6 returned, and while it's pretty clear how to...
May 2, 2006 at 10:28 am
Viewing 6 posts - 721 through 726 (of 726 total)