Forum Replies Created

Viewing 15 posts - 31 through 45 (of 156 total)

  • RE: Shrink DB

    It's likely that the original size was set to 100mb when the DB was created. That the max it can reduce to it even if all data is deleted.

     

  • RE: Finding invalid data

    This might narrow down the rows with invalid date

    DECLARE @tbl table (dt varchar(8))

    INSERT INTO @tbl

    SELECT '20070810'

    UNION

    SELECT '20070230'

    select * FROM @tbl where ISDATE(dt) = 0

  • RE: patindex in datetime field

    Check out if this helps you.

    DECLARE @dt datetime, @time VARCHAR(20)

    SET @dt = '2007-08-08 12:01 AM'

    SET @time = '9:40:24 pm'

    SELECT CASE WHEN @dt <> DATEADD(day,0,DATEDIFF(day,CAST(0...

  • RE: patindex in datetime field

    What are the datatypes of the 2 columns ? Can you include some sample data ?

  • RE: Recursive trigger ?

    Sorry for replying late.

    I got to it to work using Tomm's solution.

    I prefer not to use Replication - the volumn of data is very low (10 rows) and updates...

  • RE: maximum allowed size

    You have mentioned SQL 2000 but have posted this in SQL 2005. In SQL 2005, use can use VARCHAR(MAX). In SQL 2000, you have will to change the datatype to...

  • RE: easiest way to get the name using OBJECT_ID?

    OBJECT_NAME ( object_id )
  • RE: Need help in updating data into new table

    DECLARE @St SMALLDATETIME, @Ed SMALLDATETIME

    DECLARE @Source table (Dt SMALLDATETIME, Region varchar(2), CallNo varchar(2), Hrs decimal(10,2) )

    INSERT INTO @Source

    SELECT '1/1/2007','AA','12',7.00 

    UNION

    SELECT '1/15/2007','AA','13',                           8.50 

    UNION

    SELECT '1/29/2007','BB','14',                           5.50 

    UNION

    SELECT '2/12/2007','CC','15',                          3.00 

    UNION

    SELECT...

  • RE: Query Analyzer Script - Print Output Buffering

    Use Raiserror

    RAISERROR('Your message goes here',16,1) WITH NOWAIT

  • RE: sql job fails

    What is the error message you get ?

  • RE: @@ROWCOUNT Query

    Try

    IF NOT EXISTS ( SELECT 1 FROM #Sps)

    BEGIN

    ....

    END

     

  • RE: Eliminating Leading Char Zeros

    A word of caution about using ISNUMERIC. Check this post.

  • RE: Eliminating Leading Char Zeros

    Alternate solution

    DECLARE  @test-2 TABLE (testid INT IDENTITY(1,1), Val  VARCHAR(14))

    INSERT INTO @test-2 SELECT '00000000000002'

    INSERT INTO @test-2 SELECT '00000000000100'

    INSERT INTO @test-2 SELECT '00000000002100'

    INSERT INTO...

  • RE: Creating Dynamic Queries

    Will this solve your problem ?

    update tbldlmatrix 

          Set col = (SELECT MIN(Col) AS Expr1 

                   FROM tblDLMatrix 

                   WHERE (Dkey IN (Select varname from tblDKeys))  

                   GROUP BY Dkey

        where dkey IN (Select varname from tblDKeys)...

  • RE: Days in Month

    Avoid the overhead of a function.

    DECLARE @dt datetime

    SET @dt = '2007-02-01'

    select

Viewing 15 posts - 31 through 45 (of 156 total)