Forum Replies Created

Viewing 6 posts - 721 through 726 (of 726 total)

  • RE: Time randomization ideas

    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.

  • RE: User Defined Function Problem

    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...

  • RE: Newbie "Must declare variable" question

    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...

  • RE: Newbie "Must declare variable" question

    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...

  • RE: Newbie "Must declare variable" question

    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...

  • RE: Figuring out which values don''''t match up.

    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...

Viewing 6 posts - 721 through 726 (of 726 total)