Forum Replies Created

Viewing 15 posts - 31 through 45 (of 232 total)

  • RE: Msg 2714, Level 16, State 5, Procedure sc_CRDB, Line 65535

    you need to modify your code like below.

    IF EXISTS(SELECT 1 FROM master.dbo.sysobjects Where name='sc_CRDB' and Type='P')

    DROP PROCEDURE sc_CRDB

    GO

    CREATE PROCEDURE sc_CRDB

    AS

    IF EXISTS(SELECT 1 FROM master.dbo.sysdatabases where name='MNCPCORP')

    DROP DATABASE MNCPCORP

    --GO

    CREATE DATABASE MNCPCORP

    ON...

  • RE: sql problem

    Another way:

    ;WITH cte AS

    (

    SELECT ID

    ,dense_rank() over ( partition by ID order by ID,) AS R

    FROM MyTable

    )

    SELECT ID

    FROM cte

    WHERE R > 1

    GROUP BY ID

  • RE: Need to convert column display INT to DATETIME

    Go with Lynn. Mine is wrong in your scenario.

    It converts Second in integer value to HH:MM:SS format

  • RE: Need to convert column display INT to DATETIME

    Try this:

    SELECT DISTINCT j.name

    ,AVG(h.run_duration)

    ,substring(convert(varchar(25),(dateadd(ss

    ,AVG(h.run_duration)

    ,convert(datetime,convert(varchar(10),getdate(),121))

    )

    ),121)

    ,11,9) As AvgDuration

    FROM sysjobs j

    INNER JOIN sysjobhistory h ON h.job_id=j.job_id

    INNER JOIN

    (SELECT job_id, MAX(STR(run_date,8)+ STR(run_time,8)) as LastRunDate

    FROM sysjobhistory GROUP BY job_id) x

    ON j.job_id=x.job_id

    GROUP BY j.name

    ORDER BY j.name

  • RE: SSIS package failed when running in debug mode

    Rem-487422 (12/1/2009)


    Hi Vikas,

    Did you bring all the original names of your packages?

    I will keep you posted.

    Thanks

    REm

    Yes I did bring the original names back and it is working since then...

  • RE: Why I Run SQLServerCentral

    Steve,

    I would also say that...Please don't stop.

    I visit the site everyday...to read articles...to participate in forums...to read the discussions going on in different post....to participate in QotD. In all,...

  • RE: Result set as an email message?

    Oops...my bad...I didn't notice that...I also now think it is 2000..

    You can write a blog on configuring DBMail 🙂 Again a small but helpful article.

  • RE: Result set as an email message?

    Bru Medishetty (11/26/2009)


    Not sure, whether the OP was using SQL 2000 or 2005 ?

    Yes..He has not mentioned...

    My reply stands for 2005 and 2008;-)

    Hey Bru, I checked you site...you have small...

  • RE: Result set as an email message?

    sp_send_dbmail must be present in MSDB under system Stored procedures.

    To use this procedure to send mails first you need to configure Database Mail under the Management tab in SSMS.

  • RE: One time load using SSIS for daily loads

    You can use a for each loop in SSIS to load all the files in the folder.

    Search on BOL for details on Foreach loop.

  • RE: Result set as an email message?

    Lets wait for his reply.:Whistling:

  • RE: Result set as an email message?

    Bru Medishetty (11/25/2009)


    vikas bindra (11/25/2009)


    EXEC msdb.dbo.sp_send_dbmail

    @profile_name = 'ProfName',

    @recipients = '',

    @query = 'SELECT 1,1,1,1,1',---specify your select...

  • RE: Result set as an email message?

    EXEC msdb.dbo.sp_send_dbmail

    @profile_name = 'ProfName',

    @recipients = '',

    @query = 'SELECT 1,1,1,1,1',---specify your select query here

    ...

  • RE: Return Type in Stored Procedure

    There is no END IF in t-SQL.

    use

    IF

    BEGIN

    END

    ELSE

    BEGIN

    END

  • RE: Converting varchar to int

    Nabha (11/23/2009)


    Jeff Moden (11/20/2009)


    Nabha (11/20/2009)


    MY bad! go with Vikas, that is the right solution for you.

    Heh... no it's not...that function has a While Loop in it and it's going to...

Viewing 15 posts - 31 through 45 (of 232 total)