Forum Replies Created

Viewing 15 posts - 181 through 195 (of 508 total)

  • RE: Best way to alias column names

    My 2 cents. I find it easier to read column aliases with AS - i.e. Column1 AS NewColumnName. However, for some reason, I find table aliases easier to...

  • RE: Using a Variable for an IN Predicate

    CELKO (6/21/2011)


    Some version of this mis-use of SQL gets invented again every few months. It is a slow, dangerous mess. Are you familar with the long parameters list idiom?...

  • RE: Using a Variable for an IN Predicate

    Your Name Here (6/21/2011)


    Hey Todd

    Re: splitting a string to a table variable "array" - give this a try:

    DECLARE @values TABLE (value VARCHAR(10))

    DECLARE @xml AS XML,@str AS VARCHAR(100),@delimiter AS VARCHAR(10)

    SET...

  • RE: Using a Variable for an IN Predicate

    TheSQLGuru (6/21/2011)


    You should absolutely positively NOT use the CTE for this scenario unless you are guaranteed to have VERY few rows split out AND you do not have any signficant...

  • RE: Using a Variable for an IN Predicate

    Sarus-127369 (6/21/2011)


    too keep it simple whith less code (but only for short in-lists)

    Declare @inStr varchar(100)

    Set @inStr = '1,2,4,6'

    select * from testtable

    where ','+@inStr+',' like '%,'+cast(column as varchar)+',%'

    Saurus,

    I've used that type...

  • RE: Using a Variable for an IN Predicate

    irozenberg (6/20/2011)


    Todd, thank you for article.

    Did you try UDF that return a table?

    Cheers

    The Delimited8KSplit is a UDF that returns a table. The last example bypasses the creation of...

  • RE: comparing the varchar data type value

    Unless you have case sensitive collation for the database, the first thing SQL Server does on a string compare is convert both sides to upper case, then it compares the...

  • RE: When is shrinking a data file acceptable?

    TheSQLGuru (6/16/2011)


    1) please tell the vendor that TheSQLGuru said they have their heads up their collective @sses. Also tell them that they need to get me or some other...

  • RE: Finding dates in Dates tally table

    Jeff Moden (6/14/2011)


    Also, a Calendar table works much faster if the PK and the Clustered Index are on the Date column. Unless it's there for purposes of some type...

  • RE: Performace issue in SQL server 2008

    krishusavalia (6/7/2011)


    Hi Everyone,

    I am new into performance issue.I can post the Query or execution plan for my query which i need to improve performance.

    I am using SQL server 2008. I...

  • RE: Using SELECT INTO a bad practice?

    Jeff Moden (6/12/2011)


    allmhuran (6/12/2011)


    Interesting. Ever discovered a pattern for when they're fast or slow? I pretty much abandoned them a while ago, figuring it was just asking a bit too...

  • RE: Verify my warning trigger

    Todd,

    Messing with proprietary apps like this is probably asking for more trouble than it's worth. I've had to do it and I've found it's usually easier and more sound...

  • RE: (Nolock) created blocking?

    digdave7 (6/3/2011)


    No to sound rude, but are you kidding me by saying Nolock is a bad idea 99% of the time....? Everyone I know has clearly shown it has huge...

  • RE: slow query uses nested loop and clustered index seek, but hint for hash join is much faster

    sgambale (6/6/2011)


    I understand breaking down this query is a good idea and have told the user.

    I have statistics with all the referenced columns as the leading column in the statistic...

  • RE: stored proc occasionally hangs?

    sqldba_icon (6/6/2011)


    Thanks everyone. I don't think it is parameter sniffing issue because it doesn't take any parameters at all. Mentioned below is the query where it occasionally hangs.

    sELECT Row_number()...

Viewing 15 posts - 181 through 195 (of 508 total)