Forum Replies Created

Viewing 15 posts - 106 through 120 (of 335 total)

  • RE: Functions as arguments to Functions?

    The bottom line - outside of declaring a variable and passing the stored value, there doesn't seem to be the kind of solution that the original post was looking for...ie...

  • RE: Functions as arguments to Functions?

    The devil is in the details...

    I've used getdate() as a parameter, but only in scalar functions now that I think about it.

    Learn something new every day.

    Thanks David.

  • RE: Functions as arguments to Functions?

    Tried in QA:

    Declare @dt datetime
    set @dt=getdate()
    select * from dbo.RPT_Pledge_Match(datepart(yyyy,@dt))

    Same error...

    Server: Msg 170, Level 15, State 1, Line 1

    Line 1: Incorrect syntax near '('.

    Then did:

    Declare @dt int
    set @dt=datepart(yyyy,getdate())
    select * from dbo.RPT_Pledge_Match(@dt)

    works...

  • RE: Functions as arguments to Functions?

    No such luck:

    Select * from dbo.RPT_Pledge_Match(datepart(yyyy,getdate()))   -- Ran in QA

    Server: Msg 170, Level 15, State 1, Line 1

    Line 1: Incorrect syntax near '('.

    dbo.RPT_Pledge_Match as Char(4):

    CREATE FUNCTION [dbo].[RPT_PLEDGE_MATCH] (@campaign_year char(4))

    RETURNS TABLE...

  • RE: Need help copying one table to another. Should be easy.

    Check the schema for Table 2 to see if there's an "On Insert" trigger that may be suppressing records (i.e. duplicate keys)...

     

  • RE: Functions as arguments to Functions?

    The code inside dbo.Pledge_Match is essentially:

    Create Function dbo.Pledge_Match(@campaign_year char(4)) AS
    BEGIN
    Select {fields from both functions}
    FROM dbo.Pledge_This(@campaign_year) Pledge_This
    LEFT OUTER JOIN
    dbo.Pledge_Last(@campaign_year) Pledge_Last
    END

    dbo.Pledge_This and dbo.Pledge_Last grab the same fields from two tables for...

  • RE: Unable to access file created by DTS job

    I knew it wasn't me...

    The delete step in the file transfer job was coded incorrectly.

    This admission of course after a week of debugging and insisting that I was somehow...

  • RE: Need help copying one table to another. Should be easy.

    Are you replacing the target table or appending to it? If replacing are you using "TRUNCATE TABLE TABLE2" first? If appending, is there a Unique Primary Key on TABLE2 that...

  • RE: How to copy prod_database to test_database

    DTS has a "Copy SQL Objects" task that you can use to copy literally an entire database between servers. The only catches are that the database itself has to exist...

  • RE: DTS package to send alert e-mails

    I believe xp_smtp_sendmail requires SMTP server. I don't think it requires IIS.

    Our SQL folks are very picky about enabling extended SP's. I think xp_smtp_sendmail has prerequisite xSP's they don't...

  • RE: DTS package to send alert e-mails

    In your package properties you define new Global Variables. If you don't know how to do that I suggest you Google the topic or check a good SQL DTS book....

  • RE: DTS package to send alert e-mails

    We had piles of problems with SQLMail and our SQL folks don't want to enable xp_smtp_sendmail so we wrote a DTS package that has one ActiveX component in it to...

  • RE: Using xp_sendmail to send Word Documents stored as image

    I think I'm going to forget it and just send the recipient a link to an ASP page where they can download the document, oh well.....

     

    So you're going to...

  • RE: Using xp_sendmail to send Word Documents stored as image

    It looks like they never really resolved the xp_Sendmail issue in that thread...

    I never use xp_Sendmail -- too many issues with it. We use the CDO.Message in an ActiveX Task...

  • RE: Using xp_sendmail to send Word Documents stored as image

    You may disagree with David's wording, but he's right. You need to extract the Word doc from the database, save it to a directory, attach that file to the mail message,...

Viewing 15 posts - 106 through 120 (of 335 total)