Forum Replies Created

Viewing 15 posts - 16 through 30 (of 662 total)

  • RE: Casting Date/Time as string, padding empty chars with 0.

    Try

    Select Stuff(Stuff(Replace(Replace(Convert(Char(23),GetDate(),126),'-',''),':',''),9,1,''),15,1,'')

    Select Stuff(Stuff(Replace(Replace(Convert(Char(23),Cast('1 jan 1990 13:14:15.123' as datetime),126),'-',''),':',''),9,1,''),15,1,'')

  • RE: send output to txt file

    I think first get the BCP program going from a DOS prompt and then try to code it in TSQL

  • RE: VB APP vs Stored Procedure

    (Track_tb.Direction = 0 OR Track_tb.Direction is NULL)

    -- can be changed to

    IsNull(Track_tb.Direction,0)=0

    ---------------------------------------------------------------------------------------------------

    WHILE SUBSTRING(@TransactionType, 1,1) = ' '

      BEGIN

       SET @TransactionType = SUBSTRING(@TransactionType, 2, LEN(@TransactionType) +1)

      END

    -- Rather use

    SET @TransactionType...

  • RE: VB APP vs Stored Procedure

    I'll think understanding in detail what the app does and why should be step one.

    Optimizing current sp or rewriting it.  Example do not mix DML and DDL, as you have...

  • RE: backing up users?

    EM then right click on database and select "All Tasks" then "Generate SQL Scripts".

    Then third tab "Options" then "Script database users and database roles" and "Script SQL Server logins".

    Back to...

  • RE: Deleting Duplicate Rows

    More Complete Solution!

    Create table #Tmp(Id int,Donor_ID int)

    GO

    Insert #Tmp

     Select 933579,      100009282 union all -- Multi duplicates

     Select 933581,      100009282 union all

     Select 933582,     ...

  • RE: Deleting Duplicate Rows

    Create table #Tmp(Id int,Donor_ID int)

    GO

    Insert #Tmp

     Select 933579,      100009282 union all

     Select 933580,     100009282 union all

     Select 933550,     100020374 union all

     Select 933549,     100020374 union all

     Select 933551,     100029723 union all

     Select 933552,     100029723

    GO

    Select...

  • RE: DBCC SHOWCONTIG

    Second thoughts, rather use the quoted version!

    Select @@Version

    USE pubs

    GO

    DBCC SHOWCONTIG ('titleauthor')

    DBCC SHOWCONTIG ('titleauthor','UPKCL_taind')

    GO

     

  • RE: DBCC SHOWCONTIG

    Execute and post the result from

    Select @@Version

    USE pubs

    GO

    DBCC SHOWCONTIG (titleauthor)

    DBCC SHOWCONTIG (titleauthor,UPKCL_taind)

    GO

  • RE: Connecting using OSQL

    TRY

           osql -S us072737\inhaler1 -E

     

  • RE: DBCC SHOWCONTIG

    Try

    USE pubs

    DBCC SHOWCONTIG (titleauthor) WITH TABLERESULTS , ALL_INDEXES

    DBCC SHOWCONTIG (titleauthor,UPKCL_taind) WITH TABLERESULTS

  • RE: Returning multiple rows from single row

    Create Table #Tmp(Product VarChar(50),Quantity Decimal(10,4))

    Go

    Insert #Tmp

     Select 'Widget',5

    Insert #Tmp

     Select 'Widget',6

    Insert #Tmp

     Select 'Widget',4

    GO

    Select * from #Tmp

    Go

    Select Product,Counter,Quantity

     From #Tmp as t

      Cross Join (Select 1 Union Select 2 Union Select 3 Union Select 4...

  • RE: Fatal error 644???

    May help a bit

    http://dbforums.com/arch/30/2002/7/422872

     

  • RE: Recordset Problem

    Do you get a empty recordset? (Set nocount off)

  • RE: Is there a way to retrieve the count of all records in a database?

    BOL 2000:

    DBCC UPDATEUSAGE

    Reports and corrects inaccuracies in the sysindexes table, which may result in incorrect space usage reports by the sp_spaceused system stored procedure.

     

Viewing 15 posts - 16 through 30 (of 662 total)