Forum Replies Created

Viewing 15 posts - 2,791 through 2,805 (of 3,544 total)

  • RE: Y2K Strikes Again

    Mmmm. Must admit only done this in testing, mind you I would be happy if this was the only mistake I made, you should see some of my big faux...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Merging 12 databases

    Unfortunately no, sorry. I have no experience of Merge Replication, and when I did touch on Replication years ago, the problems I had put me off it for life. I...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Merging 12 databases

    I don't think what tool you use matters (although I'd prefer DTS) but the process you use to transfer the data. I have not done it personally but I believe...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Help with Export to Temp Table please

    quoteOk, Dave, your solution is easier, quicker to implement

    No not really. After re reading the original post 8...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: FIRST NAME,MIDDLE NAME AND LAST NAME

    Horrible but....

    SELECT LEFT(emp_name,CHARINDEX(' ',emp_name+' ')-1) AS 'FirstName',

    (CASE

     WHEN CHARINDEX(' ',emp_name,CHARINDEX(' ',emp_name)+1) = 0

      THEN ''

     WHEN (CHARINDEX(' ',emp_name,CHARINDEX(' ',emp_name)+1) -

       CHARINDEX(' ',emp_name) - 1) = 1

      THEN SUBSTRING(emp_name,CHARINDEX(' ',emp_name)+1,...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Cumulative Group By

    OK I did this without knowing your table defs. The principle is based on that you may have data missing for certain months but want to show those months with...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Dynamic SQL Stored Procedure taking date as variable

    Style is only used when converting to character.

    Use

    SELECT @date = CONVERT(datetime, @reporteddate)

    Also the test of @@ERROR will not be used as failure in date conversion will cause Level 16 error...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Help with Export to Temp Table please

    quoteWhy not simply delete the duplicates and then alter your index?

     

    And how do propose to do that Frank...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: database restore

    RESTORE DATABASE TestDatabase FROM DISK = 'D:\MSSQL7\BACKUP\LiveDatabase.DMP'

        WITH REPLACE,

             MOVE 'LiveDatabase_Data' TO 'D:\MSSQL7\Data\TestDatabase_Data.MDF',

             MOVE 'LiveDatabase_Log'  TO 'D:\MSSQL7\Data\TestDatabase_Log.LDF'

    Replace the folder locations to suit your environment

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Cumulative Group By

    CREATE TABLE calendar (

    CalDate datetime PRIMARY KEY,

    CalYear int,

    CalMonth int )

    INSERT INTO calendar values ('2003-04-01',2003,4)

    INSERT INTO calendar values ('2003-05-01',2003,5)

    INSERT INTO calendar values ('2003-06-01',2003,6)

    INSERT INTO calendar values ('2003-07-01',2003,7)

    etc

    SELECT c.CalYear,

     c.CalMonth,

     SUM(ISNULL(a.sales,0)) AS 'Total...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Intersecting/overlapping dates

    You're welcome, hope it is of some use.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Intersecting/overlapping dates

    Difficult without table defs but this may get you going but will need adjusting.

    SELECT p.PatientID,

     rl.date

    INTO #patient

    FROM Patient p

     INNER JOIN RecordLog rl

      ON rl.PatientID = p.PatientID

      AND [on-record]

    SELECT p.PatientID,

     al.date as 'StartDate',

     (SELECT ISNULL(MIN(al2.date),GETDATE())

      FROM ActiveLog al2

      WHERE al2.PatientID =...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: determining @count > 0

    No problem and I would not class it as a 'newbie' question. Like all things you either know the answer or not. The art is in knowing who to ask...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Curious Conversion

    SQL will convert and truncate data where appropriate. When converting to varchar (implicitly or explicitly) and the value is too large SQL will insert and * instead.

    See 'CAST and CONVERT'...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: determining @count > 0

    What about

    IF EXISTS(select uid from a_big_table inner join a_bigger_table on uid)

    BEGIN

    ...

    END

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 2,791 through 2,805 (of 3,544 total)