Forum Replies Created

Viewing 15 posts - 151 through 165 (of 167 total)

  • RE: Response time measure

    You could also run the SQL Profiler with -

    Events: RPC:Completed, SP:Completed, SQL:BatchCompleted

    Data Columns: Duration, TextData

    and this will give you elapsed execution time in milliseconds of each event as it...

  • RE: INSERT of consecutive numbers

    Find a C/C++ programmer and have him/her create an Extended Stored Procedure that takes 1 parameter; the number of single-column (an Int) rows to return. The column will contain the...

  • RE: Variable parameters for the where claues of a stored proc

    You could try something like:

    Select * from dbo.[YourTable] where

    (@p='' or Colp1 = @p1)

    and

    (@p2='' of Colp2 = @p2)

    and

    (...)

    and

    @p1 + @p2 +... <>''

    then there's that little problem with indices...

  • RE: Capturing The Error Description In A Stored Procedure

    To catch those elusive error messages you could also try:

    Declare @sql nVarChar(4000)

    Set @sql=N'osql -Usa -P -Q"declare @t table(PKey Int not Null) insert @t select Null"'

    Exec xp_CmdShell @sql

    and do whatever you...

  • RE: Windows Server 2003 SP1

    Hmmmm, I too had problems with SP1. After what appeared to be a clean installation my system rebooted and began reporting DLL load/entrypoint errors for MMC snap-ins and other SQL...

  • RE: deleting records without writing to transaction log

    I'm just not feeling the luv...

  • RE: deleting records without writing to transaction log

    -- Create a trigger on YourTable with the following code:

    Create Trigger [YourTableInsertTrigger] on [YourTable] Instead of Insert

    As

    Truncate Table dbo.[YourTable]

    Insert dbo.[YourTable] Select * from Inserted

    -- Execute this in your script or procedure:

    Insert...

  • RE: Suppressing Warning Messages

    This error message only indicates the "potential" to exceed the maximum record size. Var-Char/Binary columns are not always filled to maximum capacity therefore the total record length may not exceed...

  • RE: Running a SP from ASP.net

    You could be experiencing a difference in SET options from the connection type used by Query Analyzer and that of ASP.NET (ODBC?). In some cases it may be necessary to...

  • RE: Variable in select statement prevents use of index.

    You could use an index hint:

    SELECT DOCKEYID FROM DOCKEY (INDEX(YourIdexName)) WHERE DOCNBR like @DocNo

  • RE: Convert minutes to Hours:Minutes

    I generally use a function like this called with milliseconds as such:

    Print Common.dbo.mSecsToHHMMSSmmm(DateDiff(ms,@StartTime,@EndTime))

    Use Common

    Go

    If Object_Id('mSecsToHHMMSSmmm') is not Null Drop Function mSecsToHHMMSSmmm

    Go

    --------------------------------------------------------------------------------

    -- Name:

    -- mSecsToHHMMSSmmm

    --

    -- Description:

    -- Converts the specified number of milli-seconds to HH:MM:SS.mmm...

  • RE: Performance question for a 500000 row insert.

    Hmmm,

    Just noticed that you were running 500000 rows... In that case the script runs in 29 seconds

  • RE: Performance question for a 500000 row insert.

    Try something like this...

    Set NoCount On

    Declare @tbl Table(i1 Int,i2 Int,i3 Int,i4 Int)

    Declare @i Int

    set @i=0

    While @i<50000 Begin

       Set @i=@i+1

       Insert @tbl values(@i,@i,@i,@i)

    End

    Select * into RealTable from @tbl

    Create unique index IndexOnI1...

  • RE: ESP Context Identifier

    Doh!

    It would appear that I can use the value of the SRV_PROC pointer as it

  • RE: SQL Server Bug or Limit or Something else

    Try using the WITH(NOEXPAND) option in your query.

Viewing 15 posts - 151 through 165 (of 167 total)