Forum Replies Created

Viewing 15 posts - 841 through 855 (of 7,164 total)

  • RE: Call SP foreach Column in Table (without Cursor)

    Alan.B (8/20/2013)


    opc.three (8/19/2013)


    Here is a non-cursor option, just for the sake of having an alternative to using a cursor:

    DECLARE @sql NVARCHAR(MAX) = N'';

    SELECT @sql += 'EXEC LoadFile ' + QUOTENAME(FILENAME,...

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

  • RE: MAXDOP query hint doesn't work- SQL 2008R2 Enterprise Edition

    ScottPletcher (8/20/2013)


    Erland Sommarskog (8/20/2013)


    curious_sqldba (8/20/2013)


    In sys.sysprocesses wait type is always 'SOS_SCHEDULER_YIELD' when my CTP is 5 and MAXDOP is 0, what do you want me to check in sys.dm_os_tasks ?

    How...

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

  • RE: select only some rows and then the rest

    And for completeness here is your XML version that handles character entitization properly by using TYPE with FOR XML and the .value XQuery method:

    USE YourDatabaseName

    go

    IF OBJECT_ID('dbo.newtable') IS NOT NULL

    ...

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

  • RE: Call SP foreach Column in Table (without Cursor)

    Erland Sommarskog (8/19/2013)


    opc.three (8/19/2013)


    Can you please elaborate? I use this technique quite often and am interested to know what you mean by "as the correct result of SELECT statement is...

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

  • RE: select only some rows and then the rest

    Stefan_G (8/19/2013)


    But my code is still more useful since it returns the sql directly as a string to the code 🙂

    The attempt is warranted but using XML has its drawbacks....

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

  • RE: Call SP foreach Column in Table (without Cursor)

    Erland Sommarskog (8/19/2013)


    opc.three (8/19/2013)


    Here is a non-cursor option, just for the sake of having an alternative to using a cursor:

    DECLARE @sql NVARCHAR(MAX) = N'';

    SELECT @sql += 'EXEC LoadFile ' +...

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

  • RE: Call SP foreach Column in Table (without Cursor)

    Here is a non-cursor option, just for the sake of having an alternative to using a cursor:

    DECLARE @sql NVARCHAR(MAX) = N'';

    SELECT @sql += 'EXEC LoadFile ' + QUOTENAME(FILENAME, '''') +...

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

  • RE: It is possible to insert data from instance to other instance database. If yes then how to do.

    The Import and Export Wizard reachable via SSMS is quite handy to copy data to a test instance. In SSMS Object Explorer, right-click your source database, select Tasks, and choose...

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

  • RE: Identify string or integer

    In SQL 2008 and 2005 a simple SQLCLR function that leverages the TryParse method of the Int32 object is the most complete way to check for whether a string value...

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

  • RE: Script to montior ErrorLog every 1 hour

    NJ-DBA (8/18/2013)


    You might be interested in this article I wrote a while back about automatic checking of backup and error log entries via PowerShell: http://www.sqlservercentral.com/articles/powershell/76561/

    Nice use of PowerShell.

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

  • RE: select only some rows and then the rest

    Something like this?

    USE YourDatabaseName;

    GO

    CREATE TABLE newtable

    (

    softwaremanufacturer VARCHAR(100),

    productname VARCHAR(100),

    productversion VARCHAR(100),

    a VARCHAR(100),

    b VARCHAR(100),

    c VARCHAR(100),

    d VARCHAR(100)

    );

    GO

    WITH cte

    ...

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

  • RE: Log LDF file

    OnlyOneRJ (8/18/2013)


    Thanks Hanshi, Ness & GAIL...

    below will be tyhe step which will be done incase of deletion..

    1) Restore Last Full Backup (Normal Backup)

    2) Restore all Log Backup Copies after Full...

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

  • RE: Today's Random Word!

    Jeff Moden (8/16/2013)


    SQLRNNR (8/16/2013)


    Jeff Moden (8/16/2013)


    Retrofit (wishful thinking).

    partition

    Spot-on

    Spotfire

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

  • RE: Today's Random Word!

    SQLRNNR (8/16/2013)


    Jeff Moden (8/16/2013)


    Retrofit (wishful thinking).

    partition

    refactor

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

  • RE: Using the WMI Event Watcher Task in SSIS to Process Data Files

    jeanna_mcmahon (8/8/2013)


    Orlando, this guide is pretty amazing. It's exactly what I was looking for to handle random data dumps from another team that needed to be imported to a...

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

Viewing 15 posts - 841 through 855 (of 7,164 total)