Forum Replies Created

Viewing 15 posts - 301 through 315 (of 335 total)

  • RE: Update Query

    why do people always want to use cursors?

    Embrace relational theory:

    UPDATE f

       SET close_date = w.maxdate

      FROM feeback f

           JOIN (

                  select feedbackid, MAX( response_date ) AS maxdate

                    from responses GROUP...

  • RE: Defaults in the DB

    default constraints are in sysobjects type = 'D'

    values for these are in syscomments where id = sysobjects id

    table object id (sysobjects) is in the parent_obj column of the constraint row...

  • RE: Update with insert of zero

    you can use various means using

    CASE ...look it up in online help

    RIGHT( '000' + RTRIM( numbercolumn ) , 3 )

    and/or

    PATINDEX( '%[A-Z]%, numbercolumn)

    (THAT IS, I don't know what possibilities...

  • RE: VALID Varchar Values

    um, no, and I never beat my wife either.

    there's nothing special about the dash (or any other character) unless it is stripped by your client process on loading.  So take...

  • RE: VALID Varchar Values

    from what you wrote, it looks like you need varchar(20) and not (10)

    it truncates at the tenth char and these two would then be identical

  • RE: Non logged operations

    If you really have no options for space, and don't want to BCP the [desired] data out, truncate, and BCP back in (you know BCP supports select statements now)...

    I had...

  • RE: How can I find out duration of log ins to SQLServer?

    And to do that...

    you can right a proc that you run once a minute (or whatever) to look at the sysprocesses table for SPID, login_date, sid, and what ever else...

  • RE: Custom Log shipping from SQL 7 to a SQL 2000 server

    I'm not having trouble with the norecovery option on sql2k. The upgrade process only happens when the 'with recovery' option is selected. What's the syntax you're using?

  • RE: Ansi_null settings in procedure

    See the sql help on OBJECTPROPERTY function.

     

     

  • RE: Use Excel Spreadsheet in Cursor

    The first question has got to be, why do you need a cursor?

    but apart from that...

    why do you not just load the data from the spreadsheet into a temp or...

  • RE: shrink database

    If this job runs every day and needs the extra space then why do you want to shrink the DB (and force it to have to reallocate the extra space...

  • RE: sysprocesses table

    The last_batch column is the date/time of the prior statement.

    Probably this in conjunction with cmd = "AWAITING COMMAND" is sufficient (you don't want to kill something currently involved in a...

  • RE: Query across records

    it sounds like you mean that it is a two part primary key dp + num.

    so then you could do exactly the same thing except with a self join

    select...

    FROM legal...

  • RE: Way to Query a stored procedure???

    yes but the temp table layout must match what the proc is going to spit out:

     

    create proc itest

    as select id, name from sysobjects

    GO

    --1 create temp table

    select id, name into #t...

  • RE: Restoring Database

    it sounds like it is behaving as if the "NORECOVERY" option is set (meaning waiting for further tansaction logs to be applied.)

    try it the old fashioned way by TSQL:

    RESTORE DATABASE...

Viewing 15 posts - 301 through 315 (of 335 total)