Forum Replies Created

Viewing 15 posts - 151 through 165 (of 663 total)

  • RE: SQL strange problem. Please help!

    Any NULLs in your data

    Declare @chrontel_part Varchar(100)
    
    -- NULL
    Set @chrontel_part=NULL
    Select patindex('%-tr%', @chrontel_part)
    Select left(@chrontel_part, patindex('%-tr%', @chrontel_part) -1)
    Select Left(@chrontel_part,NULL)

    BOL 2000:

    If either pattern or expression is...

  • RE: Index Fragmenting

    BOL 2000:

    1) If there are multiple files in a filegroup, they do not autogrow until all the files are full. Growth then occurs using a round-robin algorithm.

    2) DBCC DEFRAGINDEX: If...

  • RE: Stored Procedure code debate

    Can you post the structured code

    Tried, but loose the plot a bit with the brackets.

    
    
    FROM entity e
    LEFT JOIN TelephoneNumber t...
  • RE: Stored Procedure code debate

    Dead code!

    ((@trueRowCount <= 200)
    
    OR (@trueRowCount > 200 AND 1 = 0))

    Assumes any combination(s) can be selected

    Think the ORs maybe a bit...

  • RE: SQL strange problem. Please help!

    First your check, check if the string contains '-tr' but for LEFT part the string must end with '-tr', thus patindex returns a 0 from which 1 is decducted and...

  • RE: UDF in sqlserver 7.0

    What I was trying to get at was to materialize the view in the end.

    mccork got their first.

    Second thought, maybe one should look at the whole...

  • RE: Generate SQl Script

    Also used scptxfr.exe and script to yyyymmdd_hhmm file for historical purposes with a small team. With a bigger team used VB/SQLDMO which updated SourceSafe a file. Handy to compare, between...

  • RE: Determining date range

    
    
    SELECT theEmp.fname+' '+theEmp.lname as fullName, tblEmployeeType.Type,
    tblEmployAccident.TrackingNumber, theEmp.Email,tblEmployAccident.Completed,
    tblAccidentInfo.staffMem,TimeOfAccident,DateOfAccident,
    Case When DateDiff(hh,DateOfAccident,GetDate()) Between 0 and 24 Then 'Employee' Else ''...
  • RE: Do you allow developer to access Production Server

    Same old problems all over the world. Powerplay, echo trips, etc.

  • RE: Determining date range

    Have a look at the CASE statement and maybe move it to the where clause.

    SELECT theEmp.fname+' '+theEmp.lname as fullName, tblEmployeeType.Type, 
    
    tblEmployAccident.TrackingNumber, theEmp.Email,tblEmployAccident.Completed,
    tblAccidentInfo.staffMem,TimeOfAccident,DateOfAccident,
    ...
  • RE: When was this index last reindexed?

    DBCC SHOW_STATISTICS

  • RE: A Brief History of SQL

  • RE: Do you allow developer to access Production Server

    There was a previous discussion on the dba / developer and it got a bit heated.

    In principal I'll go with Andy Warren answer except for the test database part. For...

  • RE: Spaces in strings.. Check this out

    
    
    Declare @r Varchar(100)
    Set @r=' a b c d e '
    While CharIndex(' ',@r)>0
    Set @r=Replace(@r,' ',' ')
    Select...
  • RE: Varchar truncation

    Does not answer the question.

    SET ANSI_WARNINGS OFF
    
    go
    DECLARE @test varchar(3)
    SET @test='More than 3'
    PRINT @test
    Go
    Create table Test(t varchar(3))
    Go
    Insert Test values('12345')
    Go
    Drop table test
    Go
    SET ANSI_WARNINGS ON
    go
    DECLARE @test...

Viewing 15 posts - 151 through 165 (of 663 total)