Forum Replies Created

Viewing 15 posts - 18,136 through 18,150 (of 18,926 total)

  • RE: Congratulations Frank

    Not sure Frank... it appears that some Dude got promoted to most valuable primate... don't know what the fuss is all about .

  • RE: How to defult date column to null?

    if object_id('test') > 0

    drop table test

    GO

    Create table test

    (

    TheDate smalldatetime null

    )

    insert into test default values

    select * from test

    /*

    thedate

    null

    */

    drop table test

    where r u displaying that date so that it appears at 1900/01/01?

  • RE: Is this possible with one query?

    Yes it's possible... but why do you want something formatted like this??

    if object_id('TEAM') > 0

    drop table TEAM

    GO

    if object_id('FILES') > 0

    drop table FILES

    GO

    CREATE TABLE TEAM

    (

    FileNumber int not null,

    TeamMember varchar(50) not null

    )

    GO

    CREATE...

  • RE: SQL Trigger

    Here's something that can help you :

    bcp pubs..authors2 in authors.txt -c -t, -Sservername -Usa -Ppassword -h "CHECK_CONSTRAINTS"

    BULK INSERT pubs..authors2 FROM 'c:\authors.txt'

    WITH (

    DATAFILETYPE = 'char',

    ...

  • RE: easy syntax question

    I would also suggest that you start using the best practice of naming the columns in the insert statement :

    Insert into dbo.MyTable (col1, col2, coln) select col1, col2, coln...

  • RE: Deleteing Old Data Automatically

    Delete from dbo.YourTable where DateCol < DateAdd(m, -18, getdate())

    You can then run this in a job whenever you need (just schedule de job to run whenever necessary).

  • RE: SQL Trigger

    R u using a bulk insert statement or just standard sql query?

  • RE: VIEW INSIDE A VIEW

    Actually UNION ALL doesn't remove dups, it's UNION that does that.

  • RE: Script to delete files older than x days?

    "LogFilePath.log", ForAppending, True /*create if not exists*/

    the 3rd parameter set to true means the the file will be created if it doesn't exists. So you don't need to do...

  • RE: Concatenation

    This is an exemple of how this trick can be converted to a function and then used in a select statement. But I agree with Kenneth that said that...

  • RE: Concatenation

    You set the variable @Job to an empty string, then you concatenate all the values that the select will return into that variable, then you can print/return/select the variable.

  • RE: INSERT Takes too Long

    Nice catch Ron... I had missed that one.

  • RE: Re: Syntax or IF statement

    no because when it is first evaluated, it is greater than 0, the value is reset after the if is evaluated.

    @MyRowcount is a different variable kept in another part of...

  • RE: INSERT Takes too Long

    That's a nice touch Noeld... but I think that the problems comes from the 50 delete statements that don't use any clustered indexes to do the deletes.. resulting in way...

  • RE: INSERT Takes too Long

    This could be cut to subsecond if you want my opinion.

    Is this what's going on??

    You have a live table where the info is kept.

    You have a staging table where new/updated...

Viewing 15 posts - 18,136 through 18,150 (of 18,926 total)