Forum Replies Created

Viewing 15 posts - 9,946 through 9,960 (of 18,926 total)

  • RE: Default NULL not working

    Ok, so that was just the UI thatw as not sending the correct information to the stored procedure.  You are using stored procedures right?

  • RE: Datetime and validity

    Select * From dbo.tbl tbl inner join (

    Select Patient_id, Max(Valid_from) from dbo.tbl where Patient_id = @SomeID group by Patient_id) dtDate

    on tbl.Patien_id = dtDate.Patient_id and tbl.Valid_from = dtDate.Valid_from

  • RE: Is this necessary to drop the indexs

    Why do you think you need to drop the indexes in the first place?

  • RE: trigger

    Been there, done that.  Welcome to the team .

  • RE: Datetime and validity

    Only one allergy can be applicable at any time?  Do you stop being allergic to peanuts once you become allergic to milk?

  • RE: Datetime and validity

    Please post the link here for further referrences.

  • RE: trigger

    You must list the columns you want to insert in the 2nd table.  You must figure this list out yourself or give us all the info so we can build...

  • RE: Datetime and validity

    Select * from dbo.TableName where valid_from <= @Date

     

    The top 1 would limit the results to one row, which is most likely not what is wanted in this case.

  • RE: Default NULL not working

    I meant the whole insert statment... I'm sure most folks smart enough to use searh engine are also smart enough to use books online

  • RE: Incorrect syntax near the keyword ''''IF''''

    Ya, those big concatenated queries are often full of surprises like this one .

  • RE: trigger

    Oops. Remove the dbo. before the deleted table.

  • RE: Incorrect syntax near the keyword ''''IF''''

    Try this

    if @TermID IS NOT NULL

    begin

    ...

    end

    IF @TaughtCourseID IS NOT NULL

    begin

    ...

    end

  • RE: using cursor

    Cancel my previous request.

     

    IF EXISTS (SELECT * FROM dbo.SysObjects WHERE Name = 'ConcatDemo' AND XType = 'FN')

     DROP FUNCTION dbo.ConcatDemo

    GO

    --Function to concatenate

    CREATE FUNCTION dbo.ConcatDemo (@TableId INT)

    RETURNS VARCHAR(8000)

    AS

    BEGIN

     DECLARE @Return AS VARCHAR(8000)

     SELECT @Return...

  • RE: using cursor

    Why are you even using a cursor or a loop to do this?

     

    Please post the tables' definition, some sample data and the required output from that sample data specifying weither you...

  • RE: Filegroups and indexes

    CREATE [UNIQUE] NONCLUSTERED INDEX IX_Name ON dbo.TblName (Col1, Col2) ON FileGroupName

     

    If you were to do this with the clustered index, the whole table would be moved to this filegroup (not...

Viewing 15 posts - 9,946 through 9,960 (of 18,926 total)