Forum Replies Created

Viewing 15 posts - 18,016 through 18,030 (of 18,923 total)

  • RE: Timestamp Column

    Maybe this will help :

    GO

    create table #t

    (

    Col1 varchar(10) not null,

    TS timestamp not null

    )

    GO

    Insert into #t (Col1) values ('test')

    Insert into #t (Col1) values ('test2')

    Insert into #t (Col1) values ('test3')

    Select *...

  • RE: help with a query

    Why don't you add a column Period and another group by by this period?

  • RE: urgent please

    We were simply suggesting the trigger solution because it would avoid doing this complexe condition twice in a row :

    WHERE Len([Rec.code]) > 2 --Check Length

    ...

  • RE: urgent please

    You don't need more... you just need to code now .

  • RE: urgent please

    That's why 2 heads are always better than one ...

    I'm not sure which solution would be better because they all seem pretty much the...

  • RE: Formating data for export

    Declare @a as decimal(18,4)

    set @a = 12345.67

    Select replace (@a, '.', '')

    --123456700

    please note that you'll always get 4 decimals even if it's an integer

  • RE: urgent please

    Or you could delete them right away from your staging table using the same where condition, but using a delete trigger to do the insert on the error table... That...

  • RE: help with script in Query Analyzer

    What executed successfully?

  • RE: help with script in Query Analyzer

    Select DISTINCT R.clinicphone from dbo.records R left outer join dbo.center C on R.clinicphone = C.clinicphone where C.clinicphone is null

    This will give you a list of clinicphones that exists in records...

  • RE: Formatting in T-SQL

    Yes there's a way as Noeld pointed out but why do you want to format your data like this?? this work is more often than not supposed to be...

  • RE: help with script in Query Analyzer

    that means that the syntax is correct, try doing a left join from the child table to the parent table to find missing keys. Correct those (either by recreating the...

  • RE: help with script in Query Analyzer

    ALTER TABLE dbo.records ADD CONSTRAINT

    FK_records_center_FKNAME FOREIGN KEY

    (

    clinicphone

    ) REFERENCES dbo.center

    (

    clinicphone

    )

  • RE: How to programatically determine all DB Drive usage

    I forgot to mention that there's also another one like this :

    sp_msForEachTable that does pretty much the same thing but for all tables in the database. Those sps...

  • RE: How to programatically determine all DB Drive usage

    It's basically an hidden cursor that you can use to execute a dynamic sql statement against each database

    run this to see what I mean :

    EXEC sp_MSforeachdb 'Select ''?'''

    it'll return...

Viewing 15 posts - 18,016 through 18,030 (of 18,923 total)