Forum Replies Created

Viewing 15 posts - 16 through 30 (of 95 total)

  • RE: Where are my system stored procedures?

    I have experienced similar results when creating a new database.  I believe nothing is visible until at least one user object is available.  Just so you know you are not...

    If the phone doesn't ring...It's me.

  • RE: Current week, last week, current month and last month

    An easier way is to set the @DateFirst to show day 1 as Monday.  Do this with:

    set datefirst 1

    If the phone doesn't ring...It's me.

  • RE: Tracking Database record changes

    Research the use of triggers on the table to track the changes or put the audit trail within the stored procedures used to update the tables.  If users can directly...

    If the phone doesn't ring...It's me.

  • RE: Problem

    To my knowledge, stored Procedures are compiled every time you alter and run the SQL of the procedure.  What is your concern or doubt?

     

    If the phone doesn't ring...It's me.

  • RE: Current week, last week, current month and last month

    Use the Datediff function:

    Current Week: DateDiff(wk,datefield,getdate()) = 0

    Previous Week: DateDiff(wk,datefield,getdate()) = 1

    Current Month: DateDiff(mm,datefield,getdate()) = 0

    Previous Month: DateDiff(mm,datefield,getdate()) = 1

    If the phone doesn't ring...It's me.

  • RE: multiple rows joined on different columns

    I'm not sure I'm following your question.  Can you post a few rows and show the select statement? 

    If the phone doesn't ring...It's me.

  • RE: how to get error description in stored procedure

    From Books On Line:

    @@ERROR is the only part of a Microsoft® SQL Server™ 2000 error available within the batch, stored procedure, or trigger that generated the error. All other parts...

    If the phone doesn't ring...It's me.

  • RE: How to use Parameterised Query in sql server

    Sivakumar,

    I don't see where you are using the sp_executesql.  The cursor declaration needs to be part of the @sql string.  But what are you trying to achieve?  It would appear...

    If the phone doesn't ring...It's me.

  • RE: Dynamically populating table name in SPROC?

    Mark is correct you could have two separate SQL statements within the proc, however beware of the execution plans.  It will be saved with the first performance and whatever table...

    If the phone doesn't ring...It's me.

  • RE: How to "Select [server1].db.dbo.table.field, [server2].db.dbo.table.field . . . Inner Join . . ." Yada Yada Yada

    That is why if find the use of table aliases critical to readability and debugging of SQL statements.  In case you haven't used them your SQL could change to:

    SELECT     t1.field1,...

    If the phone doesn't ring...It's me.

  • RE: Reporting solution without the reports?!

    Regardless of how you do it you won't get out of the query building process, however you can get out of it with some programming.  Our internal OMS was written...

    If the phone doesn't ring...It's me.

  • RE: Creating a bar graph with an attached data table

    True, but the they (Microsoft and the company creating the charting tool) are working on enhancements for this year.  Also remember this is a 1.0 product.  I'm sure it will...

    If the phone doesn't ring...It's me.

  • RE: Creating a bar graph with an attached data table

    I've just displayed the data below the chart in a table or matrix like a standard report.

    If the phone doesn't ring...It's me.

  • RE: View in queries

    My suggestion then is to add tblSite to the view in question and see what the execution plan is.  You may also want to make it a stored procedure that...

    If the phone doesn't ring...It's me.

  • RE: View in queries

    Why are you using an subquery?

    select CASE WHEN Invoice_FK IS NOT NULL THEN 'Invoice ' + ' Invoice_ID:' + CONVERT(VARCHAR,INvoice_fk) END

      , Amount as Amount

      , st.add_datetime as...

    If the phone doesn't ring...It's me.

Viewing 15 posts - 16 through 30 (of 95 total)