Forum Replies Created

Viewing 15 posts - 6,826 through 6,840 (of 7,164 total)

  • RE: Create a view that only shows columns that arent completely empty

    I would recommend handling this kind of thing outside the database...e.g. pull the resultset into a memory-resident data structure (like an ADO.NET DataTable) then remove all columns from the data...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: how to populate child dependecies for an object or any table type.

    malleswarareddy_m (3/23/2011)


    ...

    i need the child tables type also using this query.It is showing through tabletype then right click view dependencies and it showing child items in tree

    nodes.

    ...

    It sounds like maybe...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Need Records from strings

    May I ask how you ended up with delimited strings in a column? How is this data entering the system? Tools like BCP, BULK INSERT and SSIS are designed to...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: How often do you really need dynamic t-SQL?

    Jeff Moden (3/23/2011)


    opc.three (3/22/2011)


    In general dynamic sql is a bad idea and you should avoid it...

    In general, I disagree. 😀 There are some very easy steps that can...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: How often do you really need dynamic t-SQL?

    belgarion (3/22/2011)


    Sorry guys. Left out the OPTION (RECOMPILE) in my haste. Added it in. Actually, in many situations you actually find through your performance testing with multiple parameter combinations (which...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: How often do you really need dynamic t-SQL?

    sku370870 (3/22/2011)


    Just as a matter of curiousity ... I know I'll get shot down in flames ... but is what is posted above different from ...

    SELECT [SalesOrderID], [OrderDate], [Status],...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: How often do you really need dynamic t-SQL?

    Jinx! Diet Coke please Wayne 😎

    Just passing along the knowledge...Gail's article is the de facto standard on the topic.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: How often do you really need dynamic t-SQL?

    In general dynamic sql is a bad idea and you should avoid it...however your example code is building "catch all query". Have a look at this article:

    http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/%5B/url%5D

    In your case the...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Bulk copy error handling?

    BCP was designed to be fast...not tolerant of bad data or feature-rich.

    If you have data quality issues then you can ask for better data or cleanse it after you...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: help with xp_cmdshell 'XCOPY....' command

    GSquared (3/22/2011)


    I could be wrong (been a while since I used it), but I seem to remember that xp_cmdshell needs UNCs, instead of mapped drives. Is "G" a mapped...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Strip Unwanted Characters

    Try this:

    IF OBJECT_ID('test') > 0

    DROP TABLE test

    GO

    CREATE TABLE test (col VARCHAR(20))

    GO

    INSERT test

    (

    ...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Compatibility Check across multiple Modes

    SQL_Padawan_Learner (3/22/2011)


    parthi-1705 (3/22/2011)


    hi,

    Have a look on this

    declare @flg tinyint

    Select @flg= case when cmptlevel=100 then 1 when cmptlevel=90 then 2 when cmptlevel=80 then 3 end

    from master.dbo.sysdatabases

    Select @flg

    IF...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Don't understand pivot

    mtassin (3/22/2011)


    opc.three (3/22/2011)


    What you want is a dynamic cross-tab. Here is a comprehensive article about how to do that...and why cross-tabs almost always outperform the built-in PIVOT operator:

    http://www.sqlservercentral.com/articles/Crosstab/65048/%5B/url%5D

    Jeff writes great...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Error managing in T-SQL when 2 different errors are fired

    I cannot think of how you could know programmatically in T-SQL that the first one occurred...it's a popular topic right now though. Here is a related thread:

    http://www.sqlservercentral.com/Forums/Topic1082102-338-1.aspx

    As a side note...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Don't understand pivot

    mtassin (3/22/2011)


    He definately wants to use Pivot here...

    Sorry, I misunderstood the original intent behind the question.

    sku370870 (3/22/2011)


    ... are [Project 1] and [Project 2] hard-coded?

    In the real data...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 15 posts - 6,826 through 6,840 (of 7,164 total)