Forum Replies Created

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

  • RE: Join Query in sql

    Hey thats a good call made by shankar Openquery will let you to use join condition.

    OPENQUERY can be referenced in the FROM clause of a query as if it...

  • RE: Generate a unique number for a record

    Try

    Select 'EN'+CONVERT(varchar,DATEPART(yy,getdate()))+

    CONVERT(varchar,datepart(mm,getdate())) +

    CONVERT(varchar,datepart(dd,getdate()))+

    CONVERT(varchar,datepart(HH,getdate()))+

    CONVERT(varchar,datepart(MI,getdate()))+

    CONVERT(varchar,datepart(SS,getdate()))+

    CONVERT(varchar,datepart(MS,getdate()))

    this will never repeat unless you change server time.

  • RE: Recursive CTE

    Please don't cross post. It just wastes peoples time and fragments replies.

    No replies to this thread please. Direct replies to: http://www.sqlservercentral.com/Forums/Topic1099236-391-1.aspx

  • RE: Need help with date

    SQLRNNR (4/26/2011)


    See if this works any better.

    with preprocess as (

    Select internalid,txn.Terminal,txn.ActivityDate,datepart (hh,ActivityTime) As ActivityHour

    FROM dbo.ABCD txn

    WHERE ActivityDate >= '3/1/2011' AND ActivityDate < '4/1/2011'

    )

    select distinct Terminal,ActivityDate,ActivityHour

    From preprocess

    Where ActivityHour >= 23...

  • RE: Need help with date

    PSB (4/26/2011)

    SELECT DISTINCT txn.Terminal,txn.ActivityDate,datepart (hh,ActivityTime) As H

    FROM dbo.ABCD txn

    WHERE ActivityDate >= '3/1/2011' AND ActivityDate < '4/1/2011'

    AND datepart (hh,ActivityTime) <6 AND datepart (hh,ActivityTime) >= 23

    Order...

  • RE: Adding rows od data together

    Your question is not understandable what you are trying to do with this North_south and why not east_west.I am not sure for what you are looking for

    declare @Temp table...

  • RE: Delete Query

    Raghavender (4/26/2011)


    Hi All,

    We need to delete some millions of rows from a table.

    And we need this should not affect transactional log file.

    Is there a way to achieve this ?

    What are...

  • RE: WORKING WITGH STRING

    Are you asking like this

    declare @String varchar(1000)

    select @String='nhtinhfsgjesalgjdmexSUM=190SUMdsfsdfsdfsdsdsdf'

    Select SUBSTRING(@String, 1, CHARINDEX('SUM',@String)-1),REVERSE(SUBSTRING(REVERSE(@String), 1, CHARINDEX('MUS',REVERSE(@String))-1))

  • RE: Sql server

    usharani.t (4/21/2011)


    I write an stored procedure...

    the select statement returns more than one value.. how i assign that to a variable .. is it possible

    What you are trying to do with...

  • RE: Unable to Create Trigger on CDC Tables

    Ali Tailor (4/20/2011)


    Hi

    What is mean by CDC table???:crying:

    CDC is change data capture which a feature which was added in SQL 2008

    Change data capture is designed to capture insert, update,...

  • RE: Dropping a Temp Table

    Rog Saber (4/19/2011)


    In a stored proc, I am creating a temp table:

    DECLARE @TempResults TABLE

    (row_num smallint identity,

    rate_split char(1),

    ...

  • RE: Help with Query

    Is this you are looking for

    declare @test-2 table (Response_ID int, Company varchar(20),Amount decimal(18,2),Quarter tinyint,Year int)

    Insert into @test-2

    Select 1,'Company A', 100.00, 1, 2010

    union all Select...

  • RE: Get time duration from one column...

    I have made a small change in the date field

    Yours 19.04.2011and i have changed as 04/19/2011

    declare @Temp table (Time_Stamp datetime ,Action_Code tinyint, Person_ID int)

    Insert into @Temp

    Select '04/19/2011 09:03:39', 1,...

  • RE: Select query that matches data with column names

    Lynn Pettis (4/18/2011)


    parthi-1705 (4/18/2011)


    Lynn Pettis (4/18/2011)


    Why all the function calls?

    select

    'id: ' + id + ';' +

    'name: ' + name + ';' +

    ...

  • RE: Select query that matches data with column names

    Lynn Pettis (4/18/2011)


    Why all the function calls?

    select

    'id: ' + id + ';' +

    'name: ' + name + ';' +

    ...

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