Forum Replies Created

Viewing 15 posts - 76 through 90 (of 139 total)

  • RE: Find datediff in the same field

    Michael had a good point. But you can do it without a while loop. Using a temp table is fine, but can give you some performance problems when dealing with...

  • RE: Find datediff in the same field

    I found 2 solutions. The first select will not give you the row with the null value, but should perform better, the second gives you the result you want :

    use...

  • RE: Cursor order by Problem

    The default is not read-only. In Bol, you will find for the read-only option :

    "READ ONLY

    Prevents updates made through this cursor. The cursor cannot be referenced in a WHERE...

  • RE: Cursor order by Problem

    Can you tell us what type of cursor you use ? global/local, read-only, .... I suppose a cursor that is NOT read-only has more performance problems with an order-by then...

  • RE: How to Update a field that using the most recent value to replace the null value?

    You are right. We'll have to wait for a more detailed explanation. A cursor will be probably the easiest way to solve this, but I do not like cursors ......

  • RE: How to Update a field that using the most recent value to replace the null value?

    For me it works fine

    INPUT :

    PersonIDadateanint
    A2004-01-01 00:00:00.000
    A2004-01-15 00:00:00.0001
    A2004-01-19 00:00:00.000
    A2004-01-30 00:00:00.0002
    A2004-02-05 00:00:00.000
    B2004-01-03 00:00:00.0000
    B2004-01-09 00:00:00.000
    B2004-01-19 00:00:00.000

    and after the update :

    PersonIDadateanint
    A2004-01-01 00:00:00.000
    A2004-01-15 00:00:00.0001
    A2004-01-19 00:00:00.0001
    A2004-01-30 00:00:00.0002
    A2004-02-05 00:00:00.0002
    B2004-01-03 00:00:00.0000
    B2004-01-09 00:00:00.0000
    B2004-01-19 00:00:00.0000
  • RE: How to Update a field that using the most recent value to replace the null value?

    Please try this :

    set nocount on

    create table dbo.tst(PersonID varchar(30) not null, adate datetime not null, anint int null )

    insert dbo.tst (PersonID,adate) values ('A','20040101')

    insert dbo.tst...

  • RE: UDF returns table - how to use it in stored procedure

    when calling a UDF, you should at least mention the owner of the function. Something like this should work :

    insert into @table select * from dbo.fn_splitstring(@strings)

  • RE: Trigger/Check contraint implementation (urgent)

    Please try this :

    use tempdb -- for testing

    go

    create table dbo.bid     ( aut_id int primary key, bid_price money )

    create table dbo.aut_attr ( aut_id int primary key, min_bid_price money )

    go

    insert dbo.aut_attr values...

  • RE: Use a stored procedure in a select statement

    I would propose to add an optional parameter to the 2 procedures, and make them insert the results of the select in a temporary table. I would use the fact...

  • RE: Granting execute permissions

    You should verfiy if you use returnAverages in your scripts. It may be a stored procedure you forgot to script. Look for the procedure on the original server and create...

  • RE: Display NULL Columns

    Hi, I wrote this stored procedure and test script. The stored procedure installs into the master database, so you can use it in every database. Hope this will help you...

  • RE: Question of the Day for 27 Jul 2004

    I also tested this with SYBASE ... and SYBASE gives the same result as ORACLE ...

    I also tested this on SQL SERVER 2005...

  • RE: The Bowling Challenge

    Hi Andy,

    I have some questions  :

    - Can there be multiple games for 1 UserId in the table ? And if so, should the procedure only list the score of the...

  • RE: Question of the Day for 20 Jul 2004

    I have just 1 remarks. It is not true that ALL SQL servers are listenig on port 1433. 1433 is just the default value. My production servers are not listening on...

Viewing 15 posts - 76 through 90 (of 139 total)