Forum Replies Created

Viewing 15 posts - 49,426 through 49,440 (of 49,552 total)

  • RE: what''''s wrong with my cursor!!!!

    Nononono The location of the fetches is correct. You left out a necessary BEGIN... END construct. That's why the execution didn't stop.

    You must fetch before going into the loop or the...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: My Log is Full and dbcc shrinkfile failed......

    Is you database in full recovery mode? If so, backup the log. That will truncate the log and allow you to shrink it.

    If the database is in simple recovery mode,...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: what''''s wrong with my cursor!!!!

    I can't believe I missed that....

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: what''''s wrong with my cursor!!!!

    There's a few problems with this, other than the obvious that a cursor is in no way necessary here.

    You're never using the value you get from the cursor. I'm not...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Group By what ???

    Remove (dbo.t_Attachments.AttachmentID) from the Group By clause. Since you want a count of it, you don't also want to group by it.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Update Querry

    Dynamic sql is, in general, a very bad idea. It, amoung other things, leaves you very open to certain vulnerabilities, eg sql injection. See http://www.sommarskog.se/dynamic_sql.html for more detail

    That said...

    The error means...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: error 8114 + all fields are empty in the where clause

    Well 8114 is an error converting data type. My guess is that one of the fields that you're comparing with '' is of a type that empty string doesn't convert...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: information regarding sql log usage in sql server

    Hi Killer

    You're more likely to get useful responses to this if you post it in the SQL Server administration forum.

    This forum is just for discussion of the site's Question...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Problem inserting with not null fields

    Do the not null columns have defaults defined on them?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: update query...

    I think you should get a dev/playground database where you can try stuff out before running on live.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: update query...

    Unless I'm misunderstanding...

    Update tbl set B=A where B IS NULL

    tbl Before

    AB
    1a
    2NULL
    3NULL
    4d

    tbl After

    AB
    1a
    22
    33
    4d

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: is it possible to drop a table which is referenced in a view

    Sure. By altering the view like that you've removed the schemabinding, hence you can now do anything with the base table

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: is it possible to drop a table which is referenced in a view

    ???

    Create Table Testing (

     Test int

    )

    GO

    Create View vwTest WITH SCHEMABINDING AS

    Select Test FROM dbo.Testing

    GO

    DROP TABLE Testing

    GO

    The drop table returns

    Server: Msg 3729, Level 16, State 1, Line 1

    Cannot DROP TABLE 'Testing' because it...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: is it possible to drop a table which is referenced in a view

    > You CAN modify the table as long as you don't touch the columns included

    > in the view. The other columns are changeable...

    Ah. *reads fine print in BoL* So...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: is it possible to drop a table which is referenced in a view

    Create the view WITH SCHEMABINDING

    That way the tables (or other views) referenced by the view cannot be modified in any way unless the view is dropped first.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 15 posts - 49,426 through 49,440 (of 49,552 total)