Forum Replies Created

Viewing 15 posts - 1,066 through 1,080 (of 2,647 total)

  • RE: Stored Procedure Nesting Error

    Glad to help. I ALWAYS wrap my procedures in BEGIN and END for clarity as well as to avoid issues like this.

  • RE: Stored Procedure Nesting Error

    Try this:

    ALTER PROC [ShowInfo].[usp_GetShowsFromDate]

    (@InputDate AS date = '19000101')

    AS

    BEGIN

    IF @InputDate = '19000101'

    BEGIN

    SET @InputDate = CAST(GETDATE() AS date)

    END

    BEGIN

    SELECT * FROM dbo.fn_GetShowsFromDate(@InputDate)

    ORDER BY StartingDate;

    END

    END

  • RE: BCP In Issue

    As Lynn stated, we need the DDL for the export table and the import table. Looking at the error, it is telling you that the date columns are not compatible...

  • RE: Merge two select statements

    ;WITH cte (BchCode, ClusterOffdBchCode, ClusterTrip,

    ClusterAns, ClusterLess60Secs, ClusterGreat5Min) AS

    (

    SELECT ClusterOffdBchCode AS BchCode,

    COUNT(ClusterOffdBchCode) AS ClusterOffdBchCode,

    SUM(ClusterTrip) AS ClusterTrip,

    SUM(ClusterAns)...

  • RE: Merge two select statements

    Hold on... Need to fix some syntax...

  • RE: Merge two select statements

    Try this, it is the best I can do without sample data and expected results:

    Code fixed below

  • RE: Merge two select statements

    mark.doyle (4/19/2012)


    Sorry i posted the question before i completed it

    1st Select Statement

    Select BchCode,

    SUM(localOffd) As 'Local Offd Calls',

    ...

  • RE: Which way is better for script execution...

    Lynn Pettis (4/19/2012)


    I do have to say I liked Oracle's CREATE OR REPLACE. If the database object (view, stored procedure, function) already existed, it replaced it and if it...

  • RE: Which way is better for script execution...

    S_Kumar_S (4/19/2012)


    Ofcourse there is some extra code in script,but it makes sure that when i run it in different environments, it never fails.sometimes the proc may just not be there...

  • RE: Need some help with setting up database for website, lenghty post.

    jonathanalvestad (4/19/2012)


    I copied the database from that folder, and pasted it to a C:\DB\ folder.

    The file itself is just named reservasjon.mdf, but whenever I attach it to SQL Server...

  • RE: Which way is better for script execution...

    Geoff A (4/19/2012)


    the downside to 2 IMHO, is that the drop will succeed and the the create will fail....

    in option 1, if the alter fails, no harm no foul.

    also, an...

  • RE: Load Text File into Table - Seperated by Commas

    Ya, just verified it. Change your row delimiter to , instead of {CR}{LF} and your done.

  • RE: Load Text File into Table - Seperated by Commas

    Welsh Corgi (4/18/2012)


    I have this file and I need to load it into a single column TableName in a new Table.

    It is AS400 Data. The system is hosted by someone...

  • RE: Isolation Levels doubt

    In above senario both Read commited and Rean uncommited Isolations will behave in the same way.

    No. Read committed will read the committed transactions, read uncommitted will read uncommitted and...

  • RE: Back tracking of data

    Don't use CDC. CDC is best for auditing, not for actually storing historical data. You could do a trigger that simply writes all information to a history table....

Viewing 15 posts - 1,066 through 1,080 (of 2,647 total)