Forum Replies Created

Viewing 15 posts - 1 through 15 (of 16 total)

  • RE: Need a 2nd opinion on a query

    Moving some of the join logic to the WHERE clause is only equivalent when the join type is INNER. As soon as OUTER joins are introduced, that equivalence is gone.

  • RE: High-Performance Transact-SQL with Window Functions

    Having just skimmed over this posting, I'm not sure that this is relevant, but have you looked at the "quirky update" method. Yes, it's a bit dirty, but if you...

  • RE: Function Vs Stored Procedure

    Some more points:

    - Functions have some limitations (can't execute stored procedures or use temporary tables for example). Occasionally, this can bite because TTs allow for more flexibility...

  • RE: Get Line From Paragraph

    You may be interested in using a more generic function to do this that provides additional flexibility. I use a function that splits a string according to a user specified...

  • RE: Documenting Database Code: Structured Headers

    Great idea.

    I use Doxygen for generating documentation for C++ code. It's got a rich set of features and is free. Something similar for database procedures/functions would be very useful and...

  • RE: Calculate Easter Date

    I had a need to do this some time ago. I implemented a well known algorithm from an English standards organization (I've forgotten exactly who).

    This is a little shorter than...

  • RE: The February Energy Update

    Yes, the gravia lamp looks cool, but let's have a simplistic look at the physics.

    If we assume that the physical dimensions of the lamp allows a 10Kg (22lb) weight to...

  • RE: problem with float data type

    I'm sure you must know this already, but the internal storage for a TSQL Real is 4 bytes. It's the equivalent to a C/C++ float or a VB6 "Single".

    The TSQL...

  • RE: Execution time increases dramatically when using variable in query

    Gail Shaw's reply tells you why you've seen the performance difference and others have given you clues about what you can do about it.

    Adding to these, here's my suggestion.

    Look at...

  • RE: compressed(zipped) folder

    Look up 7zip (http://www.7-zip.org/). It's open source (free) and has a command line interface that will compress/decompress zip files.

  • RE: The T-SQL Quiz

    --Here's a set based solution.

    Declare @n Table (i integer Not Null, Primary Key(i))

    Insert @n

    Select 0 as i Union All

    Select 1 Union All

    Select 2 Union All

    Select 3 Union All

    Select 4 Union...

  • RE: Select nthrow to mth row

    Here's another approach. Create a table variable that will contain an Identity value and the PK field/s of your table.

    example

    Declare @rs Table (

       RecNo int Identity Not Null,

       EmpID...

  • RE: getdate() not working

    As described in the 3 posting, non-deterministic functions are not allowed in UDFs under SQL Server 2000. Microsoft have obviously had a change of heart,...

  • RE: how to get server name from IP address

    try something like this:

     

    Create Procedure sp_usr_LookUpNameFromIP (@IpAddress varchar(32), @machineName varchar(80) output)

    As

    Set NoCount On

    Declare @cmd varchar(32)

    Select @cmd = 'nslookup ' + @IpAddress

    Create Table #shellOP (

     lineText varchar(80)

    )

    Insert #shellOP

    exec master..xp_cmdshell @cmd

    Select @machineName =...

  • RE: returning most current record

    Do you have a field that captures the time of each record ?

    For the purposes of this discussion, lets assume that you have a "Date_Time" field for each record (and...

Viewing 15 posts - 1 through 15 (of 16 total)