Forum Replies Created

Viewing 15 posts - 121 through 135 (of 595 total)

  • RE: #table vs @table which is better

    quote:


    ...

    I would say that it all depends on the data you have. Personally I'm still using temp tables for a lot of...

  • RE: Establishing stored proc usage

    Set up a SQL Profiler trace tracking stored procedure statement completion. The trace can be run for a time period and stored to file or a table...more in BOL.

    ...

  • RE: Delete hierarchical data

    Yep, my mistake. Looks liek ON CASCADE DELETE is the only elegant option. My apologies.

  • RE: retrieving an ID from one table and into another

    Why do you need the EmpName in your first procedure? It's already in table theEmp. It's just redundant data at this point...

    --

    The procedure doesn't quite make sense...You are...

  • RE: Cannot Connect to SQL Query Analyzer

    Make sure the server authentication is not Windows Only. Right click on the SQL Server in Enterprise Manager, select Properties. On the Security tab, check that Authentication is...

  • RE: To NVarChar or not to NVarChar

    Agree. Don't use NCHAR or NVARCHAR unless you are absolutely positive that you require a wide character set. Many folks often are misguided into thinking that characters that...

  • RE: Date range queries

    
    
    CREATE PROC dbo.GetBasedOnDateRange
    @Start SMALLDATETIME
    , @End SMALLDATETIME
    AS
    BEGIN
    --
    SELECT FieldList, SUM(YourValueField)
    FROM TableList
    WHERE YourDateField BETWEEN @Start AND @End
    GROUP BY FieldList
    --
    END
    GO

    Hope this gets you started...

  • RE: Delete hierarchical data

    Write a trigger which deletes all rows which match on the pid. The corresponding deletes will recursively trigger more deletes, etc...

    
    
    CREATE TRIGGER dbo.MyTable_OnDelete
    ON MyTable
    FOR DELETE
    AS
    DELETE...
  • RE: How to get Raise error with info from @@ERROR

    Big topic, but to get you started...

    Basically, the tools you will need are a few variables to store the values you want to return in you error handler, a lookup...

  • RE: Tough sql statement conversion

    But you have a WHERE rownum < 2 in your Oracle statement and no such similar filter in your SQL statement. Either put a JOIN to a MAX(som_time_stamp) derived...

  • RE: Tough sql statement conversion

    quote:


    I came up with the SQL statement like this but not returning exactly what is expected:


  • RE: Tough sql statement conversion

    
    
    --...
    AND EXISTS
    (SELECT *
    FROM PSSL_T_REVISION_HISTORY ST1,
    PSSL_T_RESERVE_ENTITY ST11
    WHERE ST1.PROJECT_ID =...
  • RE: Explicit Transaction behavior fun

    quote:


    1. I originally wrote it as a single select. Unfortunately, the view has nolocks so SQL Server would put together the view...

  • RE: Where Do I Want To Go Today? - Upsert

    quote:


    In addition, I would like to mention the LIMIT clause.


    Actually, I...

  • RE: DATETIME datatype

    For those of you who saw my previous posting, which showed that the CAST method beat the DATEDIFF method, sorry, I deleted the post once I realized that the CAST...

Viewing 15 posts - 121 through 135 (of 595 total)