Forum Replies Created

Viewing 15 posts - 2,626 through 2,640 (of 13,469 total)

  • RE: Can a Stored Procedure do addition, subtraction, greater than and less than?

    yes it can, if you follow the correct construct;

    in SQl there's no THEN:

    CREATE PROCEDURE [IFTHEN] AS

    DECLARE @max-2 INT, @min-2 INT;

    SELECT

    @min-2=MIN(idt)

    ,@max=MAX(idt)

    FROM test;

    IF ((@max-@min)>50000)

    BEGIN

    PRINT 'Doing stuff.'

    ---Execute more SQL commands---

    END; ...

  • RE: Can a Stored Procedure do addition, subtraction, greater than and less than?

    it depends on what you mean;

    you can of course return results that have operations agaisnt them.

    if you mean can you pass a command and have it interpreted, then yes, with...

  • RE: Finidng which stored proc causes the error ?

    and another way:

    you can declare an explicit escape char like this:

    select

    object_name(object_id),

    definition

    from sys.sql_modules

    WHERE definition like '%referall!_orr%' ESCAPE '!'

  • RE: Query Help

    you are too quick! i edited almost right away, but you grabbed my first verison.

    i updated my post, i think it's filtering based on your date requirement now

  • RE: Query Help

    in the future, make your post title something other than "query help"; you'll get better responses if ti was something more like "empid wherethe max date?" or something descriptive.

    there's...

  • RE: Finidng which stored proc causes the error ?

    mw112009 (1/27/2014)


    We have a commercial app that fires several stored procs at the begining. Now sure which one of them is throwing an error ( Says something like column ferral_orr...

  • RE: Each Row Into a TEXT file

    if this is a one time report/export, you can select the data in ssms and chose results to text instead of to grid.

    otherwise,

    bcp.exe or sqlcmd, either using the -o parameter,...

  • RE: DataBase Mail Not Working

    my example trigger, while untested, would not error out if an automated process inserted multiple tickets in a single operation; but it would create a single email that said these...

  • RE: DataBase Mail Not Working

    well, now i see two things;

    first is a critical permissions issue:

    the end user who inserts into this table must ALSO be a user in the msdb database, and must also...

  • RE: DataBase Mail Not Working

    well, what you are seeing in the log is normal, i believe. if the service broker gets an email, it starts the database mail executable,and it's default lifetime is ten...

  • RE: DataBase Mail Not Working

    since dbmail is already set up adn running, it might be something related tot eh recipient or relaying;

    if you run this query, is the specific email you sent in...

  • RE: Performance on Computed Columns

    nothing beats actually seeing it for yourself.

    here's exactly what i did.

    for computed columns, the cost isn't a lot, but it's there.

    the key is to look at the actual execution plan.

    attached...

  • RE: Database corruption - inconsistant results

    Matt Crowley (1/23/2014)


    It might be OK. I remember in SQL 2000, if you ran DBCC checkdb against a database that was actively being updated, there was a chance you...

  • RE: Migration from 64 bit to 32 bit

    so glad it worked out for you;

    just got back from lunch, and i was just about to reply that i think you might have put a space between the slash...

  • RE: Get data from field in a previous record

    aberndt (1/23/2014)


    Lowell - You are correct, the SEQ is a number and the information that I want is associated with the SEQ # directly before that operation. I attached...

Viewing 15 posts - 2,626 through 2,640 (of 13,469 total)