Forum Replies Created

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

  • RE: Mechanics behind INSERT and UPDATE

    Hi,

    The following sql demonstrates how to test this.

    It would appear that the column is first deleted from then the new value inserted in its place.

    This is just something...

  • RE: Mechanics behind INSERT and UPDATE

    Not that I have tried it but one way to find out is to create a table then create a Trigger on it for Updates.

    When the trigger fires save the...

  • RE: Select TOP 2 Quanities Per ID

    Mark thank you for your response but the query you supplied does not work on syntax,

    Have changed it to:

    SELECT a.ID,

    MAX(a.Quantity) AS Quantity1,

    MAX(b.Quantity) AS Quantity2

    FROM MyTable a

    LEFT OUTER JOIN MyTable b...

  • RE: Select TOP 2 Quanities Per ID

    Hi,

    Thanks for the reply but I am using SQL Server 2000 so does not work.

    I am getting an Error:

    Server: Msg 156, Level 15, State 1, Line 1

    Incorrect syntax near the...

  • RE: Help needed with Duplicates within a two day period.

    Lynn,

    Looks good so far need to do a bit more testing but thanks very much for your help.

  • RE: Help needed with Duplicates within a two day period.

    Sorry for the slow reply on this, to answer a couple of questions.

    1. SQL 2000

    2. Each Prescription_ID can have many dates issued but duplicates are per ID...

  • RE: Help needed with Duplicates within a two day period.

    The table uses a composite key for the primary key by using the prescription_id and date_issued to make it unique, this is just a sample of the table loads of...

  • RE: SQL Book Recommendation

    To be honest there is no quick way to learn T-SQL properly.

    The Ben-Gan and others Inside SQL Server books are very good if not alot of reading.

    I would...

  • RE: The Best Computer

    Forgot about DARYL watched that on Channel 5 one sunday afternoon a few weeks back, was the first time my wife ever saw it, she was blubbing like a wee...

  • RE: The Best Computer

    WOPR from the 1983 file wargames, decent film as well considering when it was made.

    OR

    The computer behind everything in the new(ish) film Eagle Eye.

  • RE: Recommended path for advanced training?

    The certification route is really only effective to learn the basics of what is possible, I now know this as I am well on my way to finishing the MCITP...

  • RE: passing multiple values for one parameter

    Forgot that you can also test the output statment by replacing the "EXEC (@sqlStmt)" command with "PRINT (@sqlStmt)" . This output can then be copied to queryanlyser to run...

  • RE: passing multiple values for one parameter

    Without having the tables etc to test this against this should be pretty much there:

    This would encapsulate all the code into the variable then run it as a complete statement...

  • RE: passing multiple values for one parameter

    Hi,

    I am a fairly new DBA but what about this:

    DECLARE @sqlStmt varchar(8000)

    SELECT @sqlStmt = 'select name, center, region, customer

    from tbl1 where center = ' + @center + ' and state...

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