Forum Replies Created

Viewing 15 posts - 5,761 through 5,775 (of 6,036 total)

  • RE: very complicated stored proc

    You don't pass required parameter @searchtype. That's why SP has never been started.

    Add it to you call in application or change parameter definition to

    @searchtype int = NULL (or whatever to...

  • RE: very complicated stored proc

    In Enterprise Manager console in menu "Tools" press "SQL Profiler".

    Connect it to your database and you'll see all queries are running against this database.

    Press the button in your application and...

  • RE: very complicated stored proc

    What do you mean "there is nothing there "?

    No table created, no lines in the table, or all values are NULL?

    Can you catch SP call with Profiler?

     

  • RE: very complicated stored proc

    No, it must be first statement inside your SP, just after "AS".

  • RE: sp_executesql and several outputs in store procs

    @C is not declared inside of executed SQL string.

    You declare only N' @RetError int output', why you love it more than all other variables in your script?

  • RE: very complicated stored proc

    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[debug_SP_table]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

    drop table [dbo].[debug_SP_table]

    SELECT @dtFrom as DateFrom, @dtTo as DateTo

    INTO debug_SP_table

    and see what you really pass.

  • RE: very complicated stored proc

    Your dates are in datetime datatype.

    So pass datetime, not varchar:

    @dtFrom = convert(datetime, '01/01/2000', 103)

    @dtTo = convert(datetime, '01/01/2099, 103)

    Otherwise you depend on current DATEFORMAT settings.

  • RE: very complicated stored proc

    What's wrong with it?

    Replace

    AND (pod_Zone.id_z = @region) AND (pod_Users_Schools.id_s = @school) AND AND (pod_Event_RI.ri_id = @ri_id) AND (pod_Event_Inv.i_id = @i_id)

    with

    AND (pod_Zone.id_z = @region OR @region = 0) AND...

  • RE: dynamically generated SQL -- can''''t get @@rowcount!!

    Read BOL about sp_executesql, especially the part about using output parameters.

  • RE: set-based way to apply a rounding adjustment to the largest share

    You missed the case when 2 or more shareholders are the largest.

    Check your method for a case with 6 shareholders evenly shared the amount of 100 dollars.

  • RE: Rowfilter syntax

    Use single quote instead od double quote.

    dvresultsdetail2005.RowFilter = 'Year = 2005'

     

  • RE: Exit from a store proc if table or another storeproc not exist

    Declare @ObjectExists bit

    IF object_id(tablename) is  null

    SET @ObjectExists = 0

    ELSE

    SET @ObjectExists = 1

    .....

  • RE: varchar to Text

    You cannot use call for a function as a parameter for another function.

  • RE: dummy foreign key

    Keep your approach and get this "NOT NULL" guy away from DB  design.

    4 bytes is not only the issue.

    Imagine INNER JOIN on this FK.

    Null column will eliminate absent joins before...

  • RE: get the last 14 days

    Reverse the order:

    WHERE (date_posted <= GETDATE()) AND (date_posted >= GETDATE() - 14)

    OR, to keep it simple,  

    WHERE date_posted between GETDATE() - 14 AND GETDATE()

Viewing 15 posts - 5,761 through 5,775 (of 6,036 total)