Forum Replies Created

Viewing 15 posts - 76 through 90 (of 532 total)

  • RE: String breakup

    This would give you the rest of the char string after the first colon that appears after the first semi-colon:

    declare @init varchar(50) = 'abc:de;fgh:abcde';

    select substring(@init, charindex(':', @init, charindex(';', @init)) +...

  • RE: Issue with logical operators

    Use brackets to group your "and" and "or" conditions correctly. Right now it's going to return everything with the end date greater than the date specified regardless of the...

  • RE: Recursive querries in sql2008

    First of all, in the future, please include the DDL and insert statements ...

    create table dbo.organizationtable(

    oid int primary key,

    orgname varchar(20) not null,

    parentid int not null);

    insert into dbo.organizationtable

    values

    (10, 'unit1', 0),

    (11,...

  • RE: recursive query using cte - Please help

    It's not an old post, it's from this morning. Rather than making excuses and being dishonest accept the correction and learn from it. People are trying to help...

  • RE: & (Bitwise AND).

    Only time I've used it has been in COLUMNS_UPDATED filters for triggers.

  • RE: To VIEW or Not To VIEW ... That is the Question.

    Forbidding views doesn't really help anything in my opinion. Simply taking tools out of the toolbox doesn't prevent anyone from mishandling the tools that are still available. Like...

  • RE: Tablockx question

    Not sure what exactly you're asking, but I think that's it is possible you have unrealistic expectations of what READ COMMITTED does for you. If that is the case,...

  • RE: Create Columns using Row Data

    Do a Google search on "dynamic sql pivot" and you will find lots of info. Just make sure if you use dynamic sql to use sp_executesql. You'll find...

  • RE: Optimize hint has huge implications. Why?

    Ninja's_RGR'us (12/5/2011)


    There are probably 1000 myths about @t vs #t.

    The article I linked to list all the pros & cons of each.

    http://www.sqlservercentral.com/articles/Temporary+Tables/66720/

    Good article, but I would highlight a point that...

  • RE: Convert MSSQL date to MySQL date

    It's actually safer not to use the separators anyway. '01-02-2011' does not inherently mean anything because it's not the ANSI standard way to express a date. Rather, it's...

  • RE: Create Columns using Row Data

    So you would need to use dynamic SQL to build either a crosstab query or use the PIVOT operator. Take a crack at it.

  • RE: Optimize hint has huge implications. Why?

    One of the (many) problems in your execution plan provided is that the optimizer is expecting to get 707 records from FileSummaries but is instead getting 28,296. Because it's...

  • RE: Dynamic SQL not Executing but creates SQL Statement Correctly?

    Not sure that I understand exactly what you're doing, but don't forget you can pass variables both into and out of dynamic sql (the latter with output params.) You...

  • RE: Show rows as columns

    You can also do a crosstab which tend to work better as the queries get more complex ...

    selectinReview = sum(case when name = 'in review' then 1 end)

    ,withApplicant = sum(case...

  • RE: HierarchyID performance problems... Really???

    Itzik Ben-Gan has a good code example of a T-SQL basic (and limited) equivalent to what what the hierachyID datatype does behind the scenes (and without the coding overhead on...

Viewing 15 posts - 76 through 90 (of 532 total)