Forum Replies Created

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

  • RE: Bulk Inserting Data

    Short answer is NO,you can't.

    You have to create your table (temp ot static)first.

    If you do not have a stable data pattern in your text file how useful will be that...

  • RE: Bulk Inserting Data

    ------'C:\Test\TestBulkInsert.txt' -----

    --1, tablname1, datacolumn1, datacolumn2, datacolumn1,

    --1, tablname2, 1, datacolumn2, 2, 3

    --1, tablname2, datacolumn1, datacolumn2, datacolumn1,

    --1, tablname1, datacolumn1, datacolumn2, datacolumn1,

    --1, tablname2, 1, datacolumn2, 2, 3

    drop table #Sample

    create table #Sample(

    f1 int,

    f2 sysname,

    f3...

  • RE: Function help please

    create function dbo.MonthList(@year int)

    returns table

    as

    /*

    USAGE:

    declare @year int

    set @year=2007

    select * from dbo.MonthList(@year )

    */

    return

    select Months=upper(right(convert(varchar(11),dateadd(mm,n,dateadd(yy,@year-1900,0)),113),8))

    from (

    select  0 union all select  1 union all select  2 union all

    select  3 union all select ...

  • RE: Calculate the last working day of the previous month - Resolution

    What DATEFIRST setting do you have?

    with default which is 7 the condition :

    AND DATEPART(dw, Date) NOT IN (6, 7) /* Eliminate Weekend Dates */

    is wrong and should be "NOT IN (1,...

  • RE: How to find Last Friday without using sp

    We need to find the first Monday for the month next to target one and then subtract 3 days.

    declare @d datetime--any date within target month

    set @d=getdate()

    select LastFriday=dateadd(dd,-3,dateadd(wk,datediff(wk,0,dateadd(mm,datediff(mm,0,@d)+1,0)),0))

    Regards,

    Leonid

  • RE: FULL OUTER JOIN

    Try this

    SELECT

     site=coalesce(T3.site,T4.site),

     IPAddress,

     HostName

    FROM

     Table3 T3 FULL OUTER JOIN

     Table4 T4 ON T3.Site = T4.Site

    order by site

    --Leonid

     

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