Forum Replies Created

Viewing 15 posts - 9,946 through 9,960 (of 26,489 total)

  • RE: My Function should return selective part of String

    Luis Cazares (8/23/2012)


    I might be wrong, but I believe it's not returning the first letter from each element (Declined returns 'R').

    I would do something like this:

    CREATE FUNCTION [dbo].[FnSplit_string]

    (

    @List nvarchar(max)

    )

    RETURNS table...

  • RE: My Function should return selective part of String

    I'd just use this function:

    USE [Sandbox]

    GO

    /****** Object: UserDefinedFunction [dbo].[DelimitedSplit8K] Script Date: 08/23/2012 12:25:14 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    CREATE FUNCTION [dbo].[DelimitedSplit8K]

    /**********************************************************************************************************************

    Purpose:

    Split a given string...

  • RE: Inserts

    Sometimes you have to make assumptions. We do that every day because we don't live in a perfect world that provides us with 100% of the information we need...

  • RE: a query using covering index, merge join, hash join

    nzhang6666 (8/23/2012)


    Hi Lynn,

    Just compared the results and they are same.

    I don't understand why you suggest doing this. I mean even the data is different but they are still ordered....

  • RE: Inserts

    Why is everyone calling it a trick question? It started with (0), it is a valid value.

  • RE: Inserts

    anthony.green (8/23/2012)


    More coffee needed, I didn't read the question right, thought it was inserting many columns not 1 column, so the limit would of been 4096 so selected S,E,E doh...

  • RE: Cast and count in a single statement

    Would also help if you showed the code that is getting the error. From what I see, I don't the posted code having a problem.

  • RE: a query using covering index, merge join, hash join

    nzhang6666 (8/23/2012)


    Hi all,

    Please note the real question is at the end.

    I have following query, both pto and ph has about 30million rows. The query initially run very slow (3...

  • RE: nt given output server2000

    One other problem, if you don't select from the #temp table inside the stored procedure, you won't see any data anyways as the table will be dropped when the execution...

  • RE: Tally OH! An Improved SQL 8K “CSV Splitter” Function

    ChrisM@Work (8/23/2012)


    mtassin (8/23/2012)


    I'm not seeing the XML trouncing the Delimittedsplit8k tvf though.

    ....

    Nor me. I've plugged it into the splitter test harness from the article attachent and on some permutations of...

  • RE: Problem with query

    sandeep rawat (8/23/2012)


    table def

    table

    (

    price int,

    typeofpen varchar (20)

    )

    query

    -----

    ,WITH Temp AS

    (MAX(price ) OVER(PARTITION BY typeofpen) AS price

    FROM

    table

    )

    SELECT SUM(mx) FROM temp

    Curious, this doesn't even look like...

  • RE: synatx

    Gazareth (8/23/2012)


    Assuming you're using the DATE datatype, any of these:

    WHERE YEAR(DateField) IN (2011, 2012)

    WHERE YEAR(DateField) BETWEEN 2011 AND 2012

    WHERE DateField BETWEEN '20110101' AND '20121231'

    If there's an index on the DateField,...

  • RE: Collaspe Logic for Dates

    Phil Parkin (8/22/2012)


    vp7986 (8/22/2012)


    this logic will only apply if there are only 2 matching rows.

    If there are multiple i cannot get the match.

    Sorry, my first post was rubbish. Try this:

    create...

  • RE: Need Create View Script for all tables

    sqlvogel (8/22/2012)


    Ankur Bajaj (8/22/2012)


    Guys, thanks for your inputs. I have created the below script which serves my purpose for now.

    Cheers!

    SELECT 'CREATE VIEW ' + TABLE_SCHEMA + '.vw_' + TABLE_NAME +...

  • RE: greatest(a,b,...) function

    rakesh1084 (8/22/2012)


    HI James,:-)

    select dbo.greatest_('1099,1,2,3,9,10') greatest

    surprisingly the Result is 9

    However logically the return value should be 1099.

    even for below results are surprise

    select dbo.greatest_('1199,989') greatest, dbo.greatest_('1199,9') greatest1

    result should be 1199,119 however...

Viewing 15 posts - 9,946 through 9,960 (of 26,489 total)