Forum Replies Created

Viewing 15 posts - 16 through 30 (of 82 total)

  • RE: database relationships

    then use trigger(After Insert) on child table which handle master table.

  • RE: database relationships

    what kind of changes you want to see in child table

    please give more focus on what you want

  • RE: Changing Column Data type

    going with alter column method is best option according to me as its a primary column for your table.

  • RE: Search String in Entire Database

    any column string of entire database table.

    can you tell me purpose of doing so

    it may have batter alternate for the same.

  • RE: Search String in Entire Database

    string means what is it any column value

    like

    select * from a where abc='xyz'

    or any string in store procedure

  • RE: Joins-Left/Right Outer join

    your query return only those recode of where clause od.p_id in (1,2,3,5)

    select * from persons s left join orders od on s.p_id = od.p_id

    Where od.p_id in (1,2,3,5)

    if you want...

  • RE: Merging the rows

    try this

    declare @sql varchar(max)

    select @sql=coalesce(@sql,'')+columnname

    from

    tablename

    select @sql

  • RE: Updation

    please post table structure and more sample data

    also give more focus on what you want.

  • RE: String Function Help

    your query seems ok and working fine

    may be you are selecting LEFT(127.0.0.1,len(127.0.0.1)-charindex('.',reverse(([Ip])))) which may leads you to confusion

    you can try putting ip in select and find where's the problem

    select...

  • RE: String Function Help

    ( problem in your query

    select

    LEFT(127.0.0.1,len(127.0.0.1)-charindex('.',reverse(([Ip]))))

    from tablename

  • RE: Pivot Query

    try this if you know columns(limited columns)

    select

    (case when key='Key1' then value) as 'Key 1'

    ,(case when key='Key2' then value) as 'Key 2'

    ,(case when key='Key3' then value) as 'Key 3'

    from...

  • RE: Which is best way

    Try this

    CREATE PROC TestProc1 (@id INT)

    AS

    BEGIN

    if(@id=0) --if you pass null then no need to write this code instead of 0 for all recods from Code behind

    ...

  • RE: Improve perfomance of a table which have millions of data

    what if you use coalesce and make one query combine all diff where columns

    like

    select * from emp

    where id=coalesce(@id,id) and name=coalesce(@name,name)

    and make one index of all combine columns...

  • RE: substring/charindex

    try this one

    declare @string varchar(20)

    set @string='e33,B6661,C1'

    select substring(@string,charindex(',',@string)+1,charindex(',',@string,charindex(',',@string)+1)-charindex(',',@string)-1)

  • RE: How to convert to two decimal places

    is your chargeAmount is INT then you need to convert it to decimal to get decimal in SUM

Viewing 15 posts - 16 through 30 (of 82 total)