Forum Replies Created

Viewing 15 posts - 166 through 180 (of 463 total)

  • RE: Logic required for retaining previous value

    yeah thats fine, but how do you identify your 'first' record?

    ---------------------------------------------------------------------------------

  • RE: SELECT and REPLACE query

    Is this what you are looking for?

    Create table #t (ip varchar(1000))

    INSERT INTO #t VALUES ('http://192.49.42.39/bcccontent')

    INSERT INTO #t VALUES ('http://192.49.42.39/bcccontent1')

    INSERT INTO #t VALUES ('http://192.49.42.39/bcccontent2')

    INSERT INTO #t VALUES ('http://200.49.42.39/bcccontent1')

    Select REPLACE(ip, '192.49.42.39','192.49.42.40') ...

    ---------------------------------------------------------------------------------

  • RE: Retain previous value ..

    Dupe post.

    http://www.sqlservercentral.com/Forums/Topic824312-145-1.aspx

    ---------------------------------------------------------------------------------

  • RE: Logic required for retaining previous value

    based on which column are you saying that 1, 2 is your first record? ( i mean in which order?)

    ---------------------------------------------------------------------------------

  • RE: How can I find duplicate Entries in a table?

    SSSolice (11/24/2009)


    Nabha (11/24/2009)


    Select * from (SELECT *,

    Row_Number() OVER(PARTITION BY CustomerNumber ORDER BY

    CustomerNUmber) as row_no

    FRom CustomerContactsXref) t

    Where row_no > 1

    Hi Nabha, I was curious about any differences in...

    ---------------------------------------------------------------------------------

  • RE: Counts and Group By with more than one column

    I am guessing its a case of PIVOT. Please provide the data in the format as described in the link below. Thanks.

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    ---------------------------------------------------------------------------------

  • RE: How can I find duplicate Entries in a table?

    Select * from (SELECT *,

    Row_Number() OVER(PARTITION BY CustomerNumber ORDER BY

    CustomerNUmber) as row_no

    FRom CustomerContactsXref) t

    Where row_no > 1

    ---------------------------------------------------------------------------------

  • RE: Left and Right character comparison

    Not sure if this is what you are looking for.

    CREATE TABLE #t (varr varchar(50))

    INSERT INTO #t values ('XYZAP99123')

    INSERT INTO #t values ('XYZAP98123')

    INSERT INTO #t values ('XYZAP97123')

    INSERT INTO #t values...

    ---------------------------------------------------------------------------------

  • RE: May i use anything else instead of "IN" clause?

    Pravin Patel-491467 (11/24/2009)


    SELECT A.Name

    FROM Students

    WHERE

    A.No IN (22,34,12,67)

    Hi Guys,

    In above query i am using "IN" clause to find out Student No. but some time no. of find are very large.

    Thanks in...

    ---------------------------------------------------------------------------------

  • RE: Export excel sheet to SQL server table

    Create an SSIS package to read from the excel sheet and load it into the database. Execute this package using a sql job.

    There are lot of other ways as...

    ---------------------------------------------------------------------------------

  • RE: Compare and Round to nearest value from two tables

    Does this help you?

    Create table #user(location int, grade_value int)

    INSERT INTO #admin VALUES(1,240)

    INSERT INTO #admin VALUES(2,270)

    INSERT INTO #admin VALUES(3,300)

    INSERT INTO #user VALUES(1,246)

    INSERT INTO #user VALUES(1,273)

    INSERT INTO #user VALUES(2,301)

    Select location, grade,nearest from...

    ---------------------------------------------------------------------------------

  • RE: Return Type in Stored Procedure

    You have an 'END' and there is no corresponding begin at the start?

    ---------------------------------------------------------------------------------

  • RE: Converting varchar to int

    Simple way to do this without function

    Create table #t(t varchar(10))

    INSERT INTO #t VALUES ('1,2,3')

    INSERT INTO #t VALUES ('3,4,5,11')

    select * from #t

    where t like '%1%' and t not like '%11%'

    🙂

    INSERT...

    ---------------------------------------------------------------------------------

  • RE: Return Type in Stored Procedure

    -- END IF

    (Sorry Vikas, dint see your reply!)

    ---------------------------------------------------------------------------------

  • RE: Converting varchar to int

    Jeff Moden (11/20/2009)


    Nabha (11/20/2009)


    MY bad! go with Vikas, that is the right solution for you.

    Heh... no it's not...that function has a While Loop in it and it's going to be...

    ---------------------------------------------------------------------------------

Viewing 15 posts - 166 through 180 (of 463 total)