Forum Replies Created

Viewing 15 posts - 58,216 through 58,230 (of 59,053 total)

  • RE: Is there a better way?

    Using your current table structure, you could do this...

     INSERT LogTime (EmployeeID, CompanyID, LogIn, LogOut,

            DaysTotal,HoursTotal,MinutesTotal,SecondsTotal)

     SELECT @EmployeeID, @CompanyID, @login, @Logout,

            DaysTotal    = X.Sec / (24 * 60 * 60),

           ...

  • RE: DateTime Error

    This should do it...

    USE [DashboardSQL-2K5]

    GO

    DECLARE @return_value int

    EXEC @return_value = [dbo].[spWTRalldatareportsummary]

      @dt_src_date = CONVERT(DATETIME,N'28/04/2006',103),

      @chr_div = NULL,

      @vch_portfolio_no = NULL,

      @vch_prop_cat =...

  • RE: I need execute a sp that executes a xp_cmdshell

    P.S. Using the Linked Server method would keep you from exposing server logins in code, anywhere.

  • RE: I need execute a sp that executes a xp_cmdshell

    Thanks Hector,

    Gift Peddie posted a solution we use at work... Proxy Accounts work great for this.

    The other thing you could do is to create a linked server for the other...

  • RE: Cursors? Variable Tables and Temp Tables?

    Sorry I'm late...

    I guess you should call it RBAR since you absolutely need to read a row at a time... I'd be tempted to call it a control loop because...

  • RE: Do I need DATEPART or similar

    Hi Toni,

    Could you post the current code you are using that is coughing up the aborant data, please?

  • RE: Do I need DATEPART or similar

    Beat me to it, Conway... absolutely correct.

  • RE: Advice on using COUNT( )

    From the main screen, click on [Resources][Discussion Forums].  You will be taken to a screen with different forums.  The T-SQL forum seems to be the most popular but take the...

  • RE: Advice on using COUNT( )

    Something like this, I would imagine...

     SELECT (--Finds count of ALL distinct machine names in the table

             SELECT COUNT(DISTINCT MachineName)

               FROM yourtable

            )

          - (--Finds count of distinct machine...

  • RE: Query over two columns

    Absolutely!

  • RE: I need execute a sp that executes a xp_cmdshell

    Hector,

    What does the stored proc do with the command shell?  There might be some better ways to do things without have to use command shell...

  • RE: Do I need DATEPART or similar

    Just an alternative to Pam's good code...

    WHERE   DATEDIFF(mm,0,src_terrier.datadate) = DATEDIFF(mm,0,@dt_src_date)

    AND

        (src_terrier.Areacode = @chr_div) AND

        (src_centre_list.Portfolio_no = @vch_portfolio_no) AND

        (src_centre_list.propcat = @vch_prop_cat) AND

        (src_tbl_rental.site_ref = src_terrier.siteref)

  • RE: Cursors? Variable Tables and Temp Tables?

    Mauro,

    Just trying to clarify... are you saying that each row of the QueryDescription column contains the code for a complete query and that you want to execute all of them...

  • RE: Cursors? Variable Tables and Temp Tables?

    Mauro, I'm looking at your post right now...

  • RE: Cursors? Variable Tables and Temp Tables?

    Sorry, Mirko... I missed your post from way back in February...

    You wrote "I don't need statistics on temp tables, because I usually know enough about their structure and data that...

Viewing 15 posts - 58,216 through 58,230 (of 59,053 total)