Forum Replies Created

Viewing 15 posts - 136 through 150 (of 429 total)

  • RE: Restore a table

    Thanks Noel.

    I am going to have a long night today. I guess restore the backup to the development machine. then transfer the data is the only way. Is there an...

  • RE: incremental in second column

    Thanks Sergiy. Looks like it would work. I would try to use this in after update trigger.

    You know what in our group meeting we came to a conclusion identical to...

  • RE: incremental in second column

    It is a primary key. It will not allow. I check for the error code call same proc again which is a bad way to do it. If there a...

  • RE: incremental in second column

    There are lot of inserts that is why there is cocurrency. I even tried parent child table design. That doesn't work either as it is the same but we have...

  • RE: joins

    SET NOCOUNT ON

    DECLARE @Employee TABLE

    (

    EmpId INT,

    EmpNo INT,

    SupervisorID INT

    )

    INSERT INTO @Employee

    SELECT 1, 234, 3 UNION

    SELECT 2, 236, 5 UNION

    SELECT 3, 324, 1

    SELECT A.EmpId, A.EmpNo, A.SupervisorID, B.EmpNo SupervisorNo

    FROM

     @Employee A

    LEFT JOIN

     @Employee B

    ON

     A.SupervisorID = B.EmpId

  • RE: Select unique max value

    Schema is not clear (Atleast for me). Can you post your table design and some sample data with your expected results.

  • RE: Alternate Queries?

     select top 1 month(thedate) monthnum,count(*) rows

     from table1

     where sid='7106' and year(thedate)=2005 and ename like '%mathews%'

     group by  month(thedate)

     order by 2 desc

  • RE: A simple query question

    SELECT JPT.JobPosting_ID,

     MADT.ApplicationsReceived,

     JPT.Job_Code,

     JPT.Job_Title,

     JPT.Job_Posting_Date,

     JPT.Job_Location_Type,

     JPT.Job_Location

    FROM

     Job_Posting_Table JPT

    JOIN

     (

     SELECT JobPosting_ID, COUNT(*) ApplicationsReceived

     FROM

      Mgmt_App_Detail_Table

     GROUP BY JobPosting_ID) MADT

    ON

     JPT.JobPosting_ID = MADT.JobPosting_ID

  • RE: Good use for a cursor?

    SET NOCOUNT ON

    DECLARE @Table1 TABLE

    (

    [Name]   VARCHAR(100),

    ClockNumber  INT,

    Default_Line_Number INT,

    Default_OperationNumber INT,

    Start_date  DATETIME

    )

    INSERT @Table1

    SELECT 'Name1', 1, 11, 21, '01/01/2005' UNION

    SELECT 'Name2', 2, 12, 22, '01/02/2005' UNION

    SELECT 'Name3', 3, 13, 23, '01/03/2005' UNION

    SELECT...

  • RE: joins

    CREATE PROCEDURE Header_Insert

    (

    @pRecordType CHAR(2),

    @ptcode  CHAR(2),

    @pnotes  VARCHAR(50),

    @pDocumentID INT OUTPUT

    )

    AS

    INSERT INTO Header (RecordType, tcode, notes) VALUES (@pRecordType, @ptcode, @pnotes)

    SELECT @key = SCOPE_IDENTITY()

    GO

    CREATE PROCEDURE vendor_Insert

    (

    @pDocumentID INT,

    @pVendor VARCHAR(50),

    @prefdoc CHAR(5),

    @pintorder CHAR(10)

    )

    AS

    INSERT INTO Vendor (DocumentID, Vendor, refdoc, intorder) VALUES (@pDocumentID, @pVendor, @prefdoc, @pintorder)

    GO

    CREATE...

  • RE: Running sql through osql to produce a text file

    Can you post the schema.

    Example password.OfficerID = Requests.OfficerID

    If the OfficerID in any one of the tables is NVARCHAR and other INT, Then the NVARCHAR Column has a value 'Chief Executive'...

  • RE: Help me please before I shoot the server!!!

    Try this (Query was not tested)

    DELETE MSD

    FROM

     [mailing_sals_data] MSD

    RIGHT OUTER JOIN

     [mailing_base_data] MBD

    ON

     MSD.[delidcode] = MBD.[delidcode] AND

     MBD.[mailing_jobid] = @mailing_jobid AND

     MSD.[mailing_jobid] = @mailing_jobid

    WHERE

     MSD.[delidcode] IS NULL

  • RE: Diff between SET and SELECT

    To my knowledge both are same when used like

    select @select = 1 or set @select = 1

    But select can be used to get values from select statements, Set can just...

  • RE: SET COMMAND TO ROLLBACK

    Thanks peterhe and noeld. It was in my mind and did not come to the...

Viewing 15 posts - 136 through 150 (of 429 total)