Forum Replies Created

Viewing 15 posts - 6,166 through 6,180 (of 10,144 total)

  • RE: Stored procedure error

    @River1, here are two useful hints for you:

    1. Don't encapsulate a batch of statements into a stored procedure until you've finished debugging them - it's much easier to debug a...

  • RE: Query help!!

    Hadrian (6/27/2012)


    Thanks to all!

    I succeded to solve the problem using pre-fetch hints .

    Please share. Others with a similar problem in the future may benefit.

  • RE: Compare the text in a string (Re-post)

    Jeff Moden (6/26/2012)


    ChrisM@Work (6/26/2012)


    Jeff Moden (6/25/2012)


    ChrisM@Work (6/25/2012)


    This works quite nicely too:

    SELECT

    EmployeeID,

    Email,

    DomainLHS = SUBSTRING(Email, x.PosStart,x.PosEnd-x.PosStart),

    DomainRHS = SUBSTRING(Email, y.PosStart,y.PosEnd-y.PosStart)

    FROM @t

    CROSS APPLY (

    SELECT PosStart = 1+CHARINDEX('@',EMAIL,1),

    PosEnd = NULLIF(CHARINDEX('.',EMAIL,CHARINDEX('@',EMAIL,1)),0)

    ) x

    CROSS APPLY...

  • RE: select nth row of a concatenated query

    sh3llm4n (6/27/2012)


    Hi dudes...

    i wanna select Nth row of a concatenated column... i wrote this, but it gives me error...

    "SELECT TOP 1 test FROM (SELECT TOP 1 (name+cast(id as char)+xtype) as...

  • RE: Performance Issue that cause High CPU utilization

    There's no need at all for all the CTE's, it simply makes a trivial query look more complex than it is. If this doesn't work first time, it won't take...

  • RE: Data Delete issue

    Use indexes on those temp tables

    Create procedure usp_del_event

    @date_prm datetime = null, @daystokeep int = 15

    as

    begin

    set nocount on

    declare @date datetime

    if @date_prm is null

    begin

    set @date = GETDATE()

    end

    else

    begin

    set @date = @date_prm

    end

    set @date=convert(datetime,CONVERT(char(11),@date))

    set...

  • RE: The Cult of Mediocrity

    sturner (6/26/2012)


    patrickmcginnis59 (6/26/2012)


    Or would all companies simply agree not to pollute?

    Or do you simply have no opinion on this?

    In your mind all companies *must* pollute something in order to make...

  • RE: How to FInd Actual Row Count

    New2SQL-343122 (6/27/2012)


    Hi,

    From the Below Script, how to find Actual row count at Step 4 & Step 5.

    Basially, need to validated between Index Scan and Index Seek.

    Using SQL Server 2000.

    /* Script...

  • RE: Syntax error converting datetime from character string while calling a function

    Thanks. Resolving the expensive iTVF results in this:

    DATEADD(dd, -1, @year + '-' + MONTH(b.shpdate) + '-01')

    Can you post the code for populating the variable @year?

  • RE: What would be the best way to get the date from the following strings?

    fawadafr (6/26/2012)


    Chris:

    In your examples you are using the five product names I had provided. What would be the best way if I am dealing with 5,000+ products?

    The best way, as...

  • RE: Inner Join Duplicate Values

    Posters are encouraged to place the DDL and DML directly into a post rather than in an attached file. This looks way too big for that. Does it run?

  • RE: Inner Join Duplicate Values

    croberts 87372 (6/26/2012)


    Would I attach the sample tables or just paste into window?

    As per the article, CREATE TABLE statements and INSERT INTO statements. The article offers hints on the quickest,...

  • RE: Inner Join Duplicate Values

    croberts 87372 (6/26/2012)


    The only common field is the SourceSiteID (GUID).Just a little background to the problem. From the Point or Poly location(PntSourcem_PlySourcem) a survey (PolyNPDESSurvey) can take place. This is...

  • RE: Inner Join Duplicate Values

    croberts 87372 (6/26/2012)


    Thanks for the reply Chris, next time I will color code the sql statement.

    The first query returns 531 rows, second 633, third 247 and the fourth 1454.

    I was...

  • RE: Distinct

    river1 (6/26/2012)


    WHAT ARE CTE's?

    Can you confirm that your database is SQL Server 2008? If so, have a look in the help system (Books Online) for your client, which is...

Viewing 15 posts - 6,166 through 6,180 (of 10,144 total)