Forum Replies Created

Viewing 15 posts - 46 through 60 (of 88 total)

  • RE: SQL Query Again - Complex

    -- declare 5 variables, one for each winning number

    declare @win1 int, @win2 int, @win3 int, @win4 int, @win5 int

    set @win1 = 2  ... and each of the others

    Then,

    select * from...

  • RE: error

    It would seem that one of the columns that you are trying to change is referenced by another table.

    In EM, right click on the table name and view its dependencies....

  • RE: SQL join

    Your book contributor table holds the book ID, and the author ID, right?

    And, when you query this table, you want the book ID, with only ONE author, even if others...

  • RE: Question about Sp_Start_Job (Job dependencies)

    DTS will do this very nicely for you. Each jobs can be scheduled to run, and on completion, the next job. You can even specify two tracks, one for success...

  • RE: A record for each month, even there is no data

    A months table is probably the easiest and most elegant way to do this, but, for whatever your reasons are, if you insist on doing this WITHOUT a month table,...

  • RE: How to generate primary Keys?

    declare @NewKeyValue int

    select @NewKeyValue  = max(YourIDKeyValue) from yourtable

    insert yourtable (YourIDKeyValue ..............)

    @NewKeyValue , ......................

     

  • RE: qury to select most recent w/o duplicates

    What are the fields that are common to the two tables?

    Are you linking tblStatus.ObjectID to tblDocument.PK?

    if so,

    select DocID,     Name ,       date

    from tblDocument d

    join tblStatus s on s.ObjectID to d.PK

    join ( select ...

  • RE: Apportioning a value over certain number of rows without looping

    What is the purpose of table CP2? Is it only an aggregate of the data in CP1?

    Your table has no unique identifier. How do you link the two tables?

    Once you...

  • RE: DTS updates

    Will this work for you?

    Create a DTS job with two steps.

    1. populate a table in CRM of the values you need to change.

    2. run a stored procedure to update your...

  • RE: Data import: native Navision DB ---> SQL Server

    Not surprising. DTS is rejecting numbers that start with a comma, those would be varchar!

    Before importing the data, sort it (descending) by weight. The sort will force the commas to...

  • RE: some time query took little bit long time!!!

    Run the query several times, while other users are on the system. If the query takes longer than 10 seconds, open another Query Analyzer window.

    Run sp_who2.

    That will show you who...

  • RE: DTS updates

    Since the two servers are linked, there is no need to go through DTS.

    You need to use the four part name to reference the linked server.

    So, your query will read...

  • RE: and or

    Use the in operator. Change this to

     

    WHERE Staff_Type in ('I', 'P')

  • RE: Joins versus subqueries

    Joins ARE almost always faster to execute than subqueries.

    Why use subqueries? If your code will be read or modified in the future, it is often easier to decipher, and understand...

  • RE: problems with spaces

    if you still have trouble with the spaces, they might be tab characters, not spaces! check for char(9)!

Viewing 15 posts - 46 through 60 (of 88 total)