Forum Replies Created

Viewing 15 posts - 6,196 through 6,210 (of 7,187 total)

  • RE: Inserting random order of numbers between defined range

    Matt Miller (11/6/2007)


    Mark Green (11/6/2007)


    This code does not give me a random order of numbers. It just gives me them in numerical order. Albeit 10,000 times.

    I'm not sure...

  • RE: Inserting random order of numbers between defined range

    Mark

    It's to save you having to use a cursor or loop. Row-by-row processing is nearly always less efficient than set-based processing in T-SQL, and the numbers table allows you...

  • RE: Inserting random order of numbers between defined range

    ...or maybe even

    UPDATE Random_region_lookup_table

    SET Place_key = CASE WHEN Entry_key%354 = 0 THEN 354

    ELSE Entry_key%354 END

    or

    UPDATE Random_region_lookup_table

    SET Place_key = (Entry_key - 1)%354 + 1

    Either that or seed your identity at 0...

  • RE: Inserting random order of numbers between defined range

    Mark

    This isn't tested. It requires you to create a numbers (or tally) table called MyNumbers, with values up to at least 10,000. There's lots of discussion on this...

  • RE: Alter procedure

    One way to do it is to use DROP PROCEDURE and CREATE PROCEDURE instead of ALTER PROCEDURE. Beware, though: you will need to grant permissions again if you do...

  • RE: Check a table exist and Delete

    Dana

    That's right. You can make them take account of the schema with a little more work. For example, in my second query, you'd do something like this:

    IF EXISTS...

  • RE: Insert data from TableA to TableB

    Mmm.. sounds like you're asking us to do the whole of your homework/prjoect work for you! What have you tried so far? Here's a hint: you can't use...

  • RE: Check a table exist and Delete

    Dana

    What don't you understand? By the way, I take it you're using SQL Server 2005? If so, better to go with this one:

    IF EXISTS (

    SELECT * FROM sys.objects

    WHERE...

  • RE: SQl Query Analyzer

    Try downloading the sysinternals suite (I think) from the Microsoft website. This will enable you to see exactly what is going on under the covers on your computer. ...

  • RE: SQl Query Analyzer

    Check the path to the executable. Does the account you're logged in as have permission to run it? Also, check that the same account has permission to log...

  • RE: Adding a column to a table

    Mark

    My suggestion would be not to bother with an extra column, but instead to store that single extra value in a variable.

    John

  • RE: Join Help

    The only difference between a LEFT JOIN and an INNER JOIN is that there are some NULLs in the right-hand table where there are no matches with the values in...

  • RE: Join Help

    Perry

    I think the problem is that the last line of your ANSI-compliant query effectively turns the join with order_sales into an inner join. You haven't posted any table structure,...

  • RE: Error in BULK insert query

    Sentilnathan

    It's not really a good idea from a security point of view to use sa for application use. But from a purely technical perspective, you should be able to...

  • RE: Error in BULK insert query

    Yes, you do. The account needs to have permissions on the share that you're copying to or from.

    John

Viewing 15 posts - 6,196 through 6,210 (of 7,187 total)