Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. CurtisJM

    SQLSTATE 02000 for a Cursor Loop - How do I trap other NOT FOUND?

    One way that seems to work - but I have not tested enough yet - is to put my sql statement that might operate on an empty result set (or produce one) in a BEGIN - END block with a new condition handler... but this still seems a bit less efficient. For example - this is the beginning of my...
  2. CurtisJM

    SQLSTATE 02000 for a Cursor Loop - How do I trap other NOT FOUND?

    I am developing stored procedures in SQL. Cursor operation NOT FOUND conditions are being handled with a CONTINUE HANDLER. The problem I have is that I have SQL Statements that are also potentially raising SQLSTATE 02000 - ones that might try an assignment to a variable with a SET or a SELECT...
  3. CurtisJM

    How to access multiply query info in a Stored Procedure

    Sorry for the delay... While my recordset comment is valid, it might not be in your example cuz you wanted the count by class... So, you have to retrieve multple recordsets. Be happy that you don't have to do this in Oracle. Anyway, take a look at the section titled "Generating Multiple...
  4. CurtisJM

    quick and dirty delete of duplicate db records

    Sure... You can throw that delete statement in a variable and then execute the variable... Create Proc TST AS declare @cmd varchar(2000) alter table foo add ident INT identity set @cmd = 'delete from foo where ident > (select min(ident) from foo foo2 where foo.number = foo2.number and foo.type...
  5. CurtisJM

    How to access multiply query info in a Stored Procedure

    If you don't care about recordsets and just want to use output parameters - which is the way I would do it for scalar values - then just declare two output parms and then use SET or SELECT to assing the scalar values to @variables... if you want more spefics let me know. The advantage of this...
  6. CurtisJM

    how can i tell if sql2k instance is standard or enterprise?

    if you execute select @@version from one of the sql tools - or from any odbc type tool - it will tell you the version and type. For example: Microsoft SQL Server 2000 - 8.00.194 (Intel X86) Aug 6 2000 00:57:48 Copyright (c) 1988-2000 Microsoft Corporation Desktop Engine on Windows NT...
  7. CurtisJM

    quick and dirty delete of duplicate db records

    If you are not too space limited and the table is not too large, you could create an identity field and then use it in a correlated subquery: alter table foo add ident INT identity delete from foo where ident > (select min(ident) from foo foo2 where foo.number = foo2.number and foo.type =...

Part and Inventory Search

Back
Top