Forum Replies Created

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

  • 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...

  • 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...

  • 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...

  • 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,...

  • 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...

  • 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...

  • 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...

  • 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

  • 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...

  • RE: Intersecting/overlapping dates

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

  • 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 =...

  • 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...

  • 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'...

  • RE: determining @count > 0

    What about

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

    BEGIN

    ...

    END

  • RE: A Grain of Salt

    quoteYou know when you are trying to teach your kids to behave properly part of it is getting...

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