Forum Replies Created

Viewing 14 posts - 1 through 14 (of 14 total)

  • RE: Help - New to T-SQL

    hmm trouble is each horse is different and needs a different form change. I can't see how to make it set based

  • RE: Help - New to T-SQL

    yeh sorry changed it to I so it does it for HorseID=@I
     
    thanks for the help, finally got it lol, and yeh does it row by row.
  • RE: Help - New to T-SQL

    Ok am back LOL, Here is my latest attempt:
     
    Declare @i as int

    Declare @LstHrse as int

    set @i = 0

    set @LstHrse = 'Select Top 1 HorseID From TblHorses Order by HorseID Desc'

    while...

  • RE: Help - New to T-SQL

    hmmm no replies?

  • RE: Help - New to T-SQL

    Thank you for the great explanation. am going to think on it today how to work into what i use. Here is a rough outline of what I wanted the...
  • RE: Help - New to T-SQL

    the other alternative version i have once again still not random for each updates record:
     
    DECLARE @RandomisedNumber decimal

    DECLARE @SQL NVARCHAR(500)

    SET @SQL = N'SET @RandomisedNumber = (rand() * 2)'

     
    EXEC sp_executesql @SQL,
  • RE: Help - New to T-SQL

    hmm ok and to the other method, not sure quite wat it does, as far i can tell creates a table with 8000 records with values 1-8000
     
    then the second part...
  • RE: Help - New to T-SQL

    ok tried the above and got errors:
     
    Server: Msg 156, Level 15, State 1, Line 3

    Incorrect syntax near the keyword 'Declare'.

    Server: Msg 170, Level 15, State 1, Line 6

    Line 6: Incorrect...

  • RE: Help - New to T-SQL

    cool and that means a different random number for each record?
     
    Thanks again all of you, is so nice to be on a forum where ppl help.
     
    Dagaz
  • RE: Help - New to T-SQL

    Hmm any chance showing inside my example? as i have tried the below but still using same rand
     
    DECLARE @RandomisedNumber decimal

    DECLARE @SQL NVARCHAR(500)

    SET @SQL = N'SET @RandomisedNumber = (rand() * 2)'

    EXEC...

  • RE: Help - New to T-SQL

    ooooo have modified a bit: seems to work minus every record ending up with same result lol:
     
     
    Update ViewWeeklyFormUpdate
     
     Set Form =
     
      Case round( cast( StableHands as...
  • RE: Help - New to T-SQL

    lol ok got home and definate improvement. my only question is that rand seems to be the same rand for all records? am i wrong in this or is there...

  • RE: Help - New to T-SQL

    Thank you, once i see something layed out like that it makes so much sense and a lot easier to understand.
     
    When I get home tonight will give it a go.
     
    Dagaz
  • RE: Help - New to T-SQL

    thank u, u are a god send.
     
    Silly q now. Don't suppose you could do a simple example? if too much to ask dont worry.
     
    But thanks anyways at least i have...

Viewing 14 posts - 1 through 14 (of 14 total)