Forum Replies Created

Viewing 15 posts - 61 through 75 (of 87 total)

  • RE: Errors in bcp and bulk insert

    SQL server and csv file are on a same mashine?

    I Have Nine Lives You Have One Only
    THINK!

  • RE: Errors in bcp and bulk insert

    8.0

    10

    1 SQLNCHAR 0 3 "," 1 CompanyID ""

    2 SQLNCHAR 0 9 "," 2 ItemCode ""

    3 SQLNCHAR 0 38 "," 3 Descritpion ""

    4 SQLNCHAR 0 9 "," 4...

    I Have Nine Lives You Have One Only
    THINK!

  • RE: sorting through duplicate data

    declare @t table(

    MasterID Int,

    SubID varchar(10),

    [SubID Price] decimal(5,2)

    )

    insert into @t values

    (1234, 'aa', 1.00),

    (1235, 'cc', 4.00),

    (1234, 'bb', 0.50)

    ; with cte

    As (

    select

    t.MasterID

    , min(t.[SubID Price]) mp

    from

    @t t

    group by

    t.MasterID

    having

    count(*) > 1)

    select

    t.MasterID

    , t.SubID

    , t.[SubID Price]

    from

    @t...

    I Have Nine Lives You Have One Only
    THINK!

  • RE: how to Force Default Value in case of Null insertion.

    azhar.iqbal499

    in this case, you have to use "insted of" triger

    I Have Nine Lives You Have One Only
    THINK!

  • RE: how to Force Default Value in case of Null insertion.

    insert into #CheckConstraint(ID,Price)

    values(2,default)

    can you change null value to default in Application?

    I Have Nine Lives You Have One Only
    THINK!

  • RE: SQLAgent.out

    try this

    create table #t(list varchar(100))

    insert into #t(list)

    exec xp_cmdshell 'dir /-C "c:\Program Files\Microsoft SQL Server\MSSQL\LOG\sqlagent.out"'

    declare @size Int

    Select

    cast(replace(Substring(t.list, 20, Len(t.list) - 20 - 12), ' ', '') As Int)

    From

    #t t

    Where

    CharIndex('sqlagent.out',...

    I Have Nine Lives You Have One Only
    THINK!

  • RE: How to avoid first part of the string and consider the rest of it?

    SUBSTRING (Transact-SQL)

    Returns part of a character, binary, text, or image expression

    SUBSTRING (value_expression ,start_expression ,length_expression )

    length_expression

    Is a positive integer or bigint expression that specifies how many characters of the value_expression will...

    I Have Nine Lives You Have One Only
    THINK!

  • RE: UPDATE problem inside SQL Script

    i dont know

    do this

    create index ix1 on #tempCDI(CDIID)

    and try again

    I Have Nine Lives You Have One Only
    THINK!

  • RE: UPDATE problem inside SQL Script

    ok

    problem is here

    UPDATE CDI

    SET statustypeid = t.statustypeid

    FROM #tempCDI t

    INNER JOIN DBO.CDI CDI ...

    I Have Nine Lives You Have One Only
    THINK!

  • RE: UPDATE problem inside SQL Script

    How many records in the table?

    Check up statistics and indexes

    I Have Nine Lives You Have One Only
    THINK!

  • RE: group by help... pls

    select top 1 address from loca where loca.sno=main.sno

    add order by ...

    and queries wiil be identical

    I Have Nine Lives You Have One Only
    THINK!

  • RE: Help Needed In Query

    select

    t1.tabPrtId

    , t1.tabSlab

    , t2.tabSlab

    from

    @t t1

    left join @t t2 on t2.tabid = t1.tabid + 1 and t2.tabPrtId = t1.tabPrtId

    or

    select

    t1.tabPrtId

    , t1.tabSlab

    , min(t2.tabSlab)

    from

    @t t1

    left join @t t2 on t2.tabid > t1.tabid and...

    I Have Nine Lives You Have One Only
    THINK!

  • RE: UPDATE problem inside SQL Script

    try this

    UPDATE DBO.MEASURE

    SET statustypeid = t.statustypeid

    FROM #tempFinalMeasure t

    WHERE

    DBO.MEASURE.measureid=t.measureid AND DBO.MEASURE.statustypeid <> t.statustypeid

    I Have Nine Lives You Have One Only
    THINK!

  • RE: Using CTE Common table expressions with SELECT CASE statement

    is this?

    declare @test1 table(a int)

    declare @test2 table(a int)

    insert into @test1(a)values(1)

    insert into @test1(a)values(2)

    insert into @test1(a)values(3)

    insert into @test1(a)values(4)

    insert into @test2(a)values(10)

    insert into @test2(a)values(20)

    DECLARE @r INT

    SELECT @r = 2

    ;WITH sam AS (

    select...

    I Have Nine Lives You Have One Only
    THINK!

  • RE: Problem in Join Query

    1.

    select

    p.ProductId

    , p.ProductName

    , p.CategoryId

    from

    Product p

    where

    p.CategoryId = 1

    and (select count(distinct DescriptorValueId) from ProductDescriptorMapping pdm where pdm.ProductId = p.ProductId and pdm.DescriptorValueId in (1,2,3)) = 3

    2.

    select

    p.ProductId

    , p.ProductName

    , p.CategoryId...

    I Have Nine Lives You Have One Only
    THINK!

Viewing 15 posts - 61 through 75 (of 87 total)