Forum Replies Created

Viewing 15 posts - 1 through 15 (of 28 total)

  • RE: Things You Didn't Know About Temp Tables and Table Variables

    Thank you all for your great feedbacks.

    In this article I tried to illuminate things I didn't find in any other article. In order to find common differences between Variable...


    Kindest Regards,

    Roi Assa

  • RE: Linked Server Optimization

    You should understand what kind of data (and amount) you have in both servers (local and remote) when you're using linked server.

    Sometimes you'd like to run the join on the...


    Kindest Regards,

    Roi Assa

  • RE: Sort column without ORDER BY

    The reason is tables are not ordered by definition and views are at the same category (RDBMS), if you need an ordered results you must specify "order by".

    The solution of...


    Kindest Regards,

    Roi Assa

  • RE: Number of Databases in SQL 2005 affecting performance

    Part of upgrading to 2005 is rebuilding all indexes.

    Try to analyze (dbcc showcontig or DMV) your indexes to verify this issue.

     


    Kindest Regards,

    Roi Assa

  • RE: call store procedure or using transact sql in asp

    You can declare @Error as output and do something like that:

     

    DECLARE @Error INT -- Output in procedure

    SET @Error = 0

    Begin Transaction

    INSERT Table1 ...

    Values ...

    SET @Error = @@Error

    If @Error <> 0

    begin

     GOTO...


    Kindest Regards,

    Roi Assa

  • RE: What makes it faster?

    Can you add execution plan?

    Are you running both from same source?

    If you are running this procs on testing environment try to run sp_recompile / DBCC FREEPROCCACHE and let us know...


    Kindest Regards,

    Roi Assa

  • RE: TYPE CAST ERROR

    Try this one:

    SELECT *

    FROM tableX

    WHERE ISNUMERIC(Quantity) = 0

     


    Kindest Regards,

    Roi Assa

  • RE: Day of Week Function

    I tried to calculate your function with:

    SELECT @DayDiff = DATEDIFF(DAY,@startdate,@EndDate)

    and then dividing by 7 (week days) and ceiling etc.

     

    My code looks "cleaner" but when I checked performance it looks the...


    Kindest Regards,

    Roi Assa

  • RE: Replace column values

    what is your table name? Seems that you wrote column name instead table name.

    Are you sure you need the query above and not this one:

     

    UPDATE providerlistforfirstq...


    Kindest Regards,

    Roi Assa

  • RE: Identifying duplicate sets

    You can use the results as derived table / join table within update statement


    Kindest Regards,

    Roi Assa

  • RE: Row size in bytes

    One way to find this information is:

     

    DBCC SHOWCONTIG (Table_Name) WITH TABLERESULTS


    Kindest Regards,

    Roi Assa

  • RE: Using TOP with a variable

    This is another way to do it:

     

    -- This code will be parameter in procedure

    declare @top tinyint

    set @top = 10

    -- Declare variable

    declare @sql NVARCHAR(4000)

    -- This is your code

    SET @sql =   'SELECT...


    Kindest Regards,

    Roi Assa

  • RE: Identifying duplicate sets

    This code might help you:

     

    -- Simulate data

    SET NOCOUNT ON

    CREATE TABLE #DUP (ID INT IDENTITY(1,1), BP INT, SEQ INT, TYPE INT)

    INSERT #DUP VALUES (100 ,1 ,1 )

    INSERT #DUP VALUES (100, 2,...


    Kindest Regards,

    Roi Assa

  • RE: Finding which table is on a page

    You can find ObjId in the page header when running DBCC PAGE.


    Kindest Regards,

    Roi Assa

  • RE: LDAP time to datetime conversion?

    What about using function like that:

     

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

    CREATE FUNCTION udf_ConvertLDAPToDatetime (@TextToConvert nvarchar(50))

    RETURNS DATETIME

    AS

    BEGIN

     DECLARE @RETURN_DATE DATETIME

     DECLARE @DATE DATETIME

     DECLARE @HOUR INT

     DECLARE @MINUTE INT

     DECLARE @SECOND INT

     SET @DATE = CONVERT(DATETIME, SUBSTRING(@TextToConvert,1,8),121)

     SET @HOUR = SUBSTRING(@TextToConvert,9,2)

     SET @MINUTE =...


    Kindest Regards,

    Roi Assa

Viewing 15 posts - 1 through 15 (of 28 total)