Forum Replies Created

Viewing 15 posts - 46 through 60 (of 78 total)

  • RE: Query to get the minimum id

    create table log

    (

    ecode int,

    id int,

    eff_date datetime

    )

    insert into log

    select 100,1,'03/jun/2009'

    union all

    select 100,2,'02/jun/2009'

    union all

    select 100,3,'16/jun/2009'

    union all

    select 200,1,'07/jun/2009'

    union all

    select 200,2,'08/jun/2009'

    union all

    select 200,3,'05/jun/2009'

    ;with test AS (

    select ecode, ID,

    ...

  • RE: String Stuffing

    ningaraju.n (5/29/2009)


    Thanx Saurabh for ur reply

    but i may contain this text also

    @text='CAST(@Id nvarchar(100))

    CAST ((@pageNo * PageSize - 1) NVARCHAR(100))

    CAST (''&Parameter'' NVARCHAR(100))'

    when i...

  • RE: help with distinct please :(

    Ramesh (5/27/2009)


    Labneh (5/27/2009)


    I'm sorry for not posting it the right way.

    i got it... didn't have to use row_number... here it is in case someone is in a crunch

    SELECT T1.*

    FROM TableName...

  • RE: String Stuffing

    ningaraju.n (5/27/2009)


    Thanx saurabh.dwivedy

    The code is dynamic...

    Occurence of CAST is not Known..... it may occur 100 times or 0 times

    and the Variables inside the cast also not known...

    and the code...

  • RE: String Stuffing

    Declare @Text NVARCHAR(max)

    Set @Text='

    DECLARE @userid INT

    SELECT * FROM [User] WHERE UserId=@userId

    DECLARE @Id INT,@IS as NVARCHAR(10)

    SELECT CAST(1 BIGINT)

    SELECT * FROM [Role]

    SELECT CAST(@id NVARCHAR(100))

    declare @IG nvarchar(100)

    select * from...

  • RE: T SQL

    I too am getting the following answer (like quite a few others)

    Vyas Mohan

    Mohan Shobha ...

  • RE: Polymorphed Proc

    Dear DPhillips,

    Thank you for the painstakingly elaborate explanation. Took me a while to figure out - not because the explanation was lacking in anyway - but due to my own...

  • RE: Polymorphed Proc

    DPhillips (3/17/2009)


    Chris Harshman (3/17/2009)


    I'm just suprised that SQL Server would let a stored procedure modify its own code. That's the real head scratcher here. :ermm:

    Many code environs can...

  • RE: Recursive select Query

    bhakti (5/8/2009)


    A--

    |

    |-B --

    | |-E

    | |-F

    | ---

    |-C--

    --- |-D

    Suppose this is my hierarchy of Employees. Employee D ReportsTo C and Employee E & F Reports To B. Employee B & C...

  • RE: Best Option

    Wow!!

  • RE: Problem with the Query

    nageswara.dhaveji (5/7/2009)


    Hi,

    I have modified my query which I have posted earilier... try this ...

    create table #temp (name VARCHAR(100), first_name VARCHAR(50), last_name VARCHAR(50))

    truncate table #temp

    INSERT INTO #temp (name) ...

  • RE: Problem with the Query

    DECLARE @t table (name varchar(100), fname varchar(50), lname varchar(50))

    INSERT INTO @t

    SELECT 'Bill+Gates', '','' UNION ALL

    SELECT '+Steve', '','' UNION ALL

    SELECT 'Jobs+', '', ''...

  • RE: Problem segregating third occurence from a column

    Thanks Rayash. I am sure you are aware and realize it but I will still say that my solution is not elegant: It uses a cursor based approach which is...

  • RE: Best Insert Option

    Ramesh (5/4/2009)


    Most of the time cursors/loops performs poorly than set based methods with only some rare cases when loops performs better than a set-based approach.

    In your case, one go insert...

  • RE: Problem segregating third occurence from a column

    DECLARE @addr VARCHAR(1000), @delim CHAR(1), @x INT

    SET @delim = '*'

    SET @addr = '5605 PRINCETON AVE STE B* COLUMBUS* GEORGIA*31904*(01/11/06 - 03/26/09)'

    ...

Viewing 15 posts - 46 through 60 (of 78 total)