Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)

  • RE: Latest record but with extra info from previous one

    Gianluca Sartori (1/25/2012)


    GROUP BY should do the trick:

    -- SAMPLE DATA

    DECLARE @Audit TABLE (

    [ID] int,

    [Modified on] datetime,

    [Previous Delivery Date] datetime,

    [New Delivery Date] datetime

    )

    SET DATEFORMAT dmy

    INSERT INTO @Audit

    ...

  • RE: Data Import from one table to another

    I guess your problem is over here

    [cmpy_code] [char](2) NOT NULL[\b]

    [par_code] [char](8) NOT NULL[\b]

    and thats why when you are trying to insert your records using

    NSERT INTO dbo.parent (pud12_code,pud24_text)

    SELECT Bus, Pickup_time

    FROM dbo.Upload

    WHERE...

  • RE: Help with a SELECT statement using GROUP and SUM

    how about this...

    DECLARE @mytable AS TABLE(CardType nvarchar(50),Completed BIT)

    insert into @MyTable

    VALUES

    ('ATM_Issue.CRD', 1),

    ('ATM_RePIN.CRD' ,0),

    ('Debit_Business_Issue.CRD', 0),

    ('Debit_Business_RePIN.CRD', 1),

    ('ATM_Issue.CRD', 1),

    ('ATM_RePIN.CRD' ,0),

    ('Debit_Business_Issue.CRD', 1),

    ('Debit_Business_RePIN.CRD', 0),

    ('ATM_Issue.CRD', 1),

    ('ATM_RePIN.CRD' ,0),

    ('Debit_Business_Issue.CRD', 0),

    ('Debit_Business_RePIN.CRD', 1),

    ('ATM_Issue.CRD', 1),

    ('ATM_RePIN.CRD' ,0),

    ('Debit_Business_Issue.CRD', 1),

    ('Debit_Business_RePIN.CRD', 0),

    ('ATM_Issue.CRD', 0),

    ('ATM_RePIN.CRD' ,1),

    ('Debit_Business_Issue.CRD', 1),

    ('Debit_Business_RePIN.CRD',...

  • RE: Linking an Access table to SQL Server

    You can also create a linked server under the server objects in Management studio and then query your access tables

  • RE: Export SQL table from one server to another

    Perhaps you could use SSIS but it requires at least one sql server standard edition.

    Another option is Linked server but i think it requires at least one sql server standard...

  • RE: Does alter index rebuild cause sp recompile?

    GilaMonster (12/14/2011)


    sroumel (12/14/2011)


    Maybe it doesn't matter,

    rebuild index triggers update statistics and then the plan recompiles

    Rebuild doesn't trigger update stats, it does the update as part of the index rebuild,...

  • RE: Does alter index rebuild cause sp recompile?

    Maybe it doesn't matter,

    rebuild index triggers update statistics and then the plan recompiles,

    what matters what happens first?

  • RE: Split the column values from a query

    My thought ... almost

    select y.status, COUNT(*)as meter_cnt

    from (

    select case

    when x.recission_date > x.flow_end_date then 'cancelled'

    when x.flow_end_date IS null and x.flow_start_date IS not null then 'active'

    when x.flow_end_date...

  • RE: SQL 2005 express - Automatic backups

    In such case i'm using sqlcmd

    Create a .bat file like this

    sqlcmd -U username -P password -S server -i .\backup.sql

    in the same folder save the following as backup.sql

    DECLARE @path AS...

  • RE: caculate age from birthdate in SQL stored procedure

    I think that adding a WHERE in your stored procedure will work

    e.g.

    UPDATE table

    SET col1 = 'some value'

    WHERE DATEDIFF(yy,Birthdate,getdate()) < 23

    unless i miss something...

Viewing 10 posts - 1 through 10 (of 10 total)