Forum Replies Created

Viewing 15 posts - 106 through 120 (of 161 total)

  • RE: getdate() function SQL SVR 7

    hi,

    a quick and dirty way is to convert to a char field :-

    select convert(char(11),getdate())

    HTH

    Paul

  • RE: Grouping records

    hi, i did the following :-

    create table activity

    (activityid int, activity_name varchar(10), parentid int)

    insert into activity values (1,"Golf",0)

    insert into activity values (2,"Golf1",1)

    insert into activity values (3,"Spa",0)

    insert into activity values (4,"Golf2",1)

    insert into...

  • RE: Max Date Problem

    hi,

    this might give you a nudge in the right direction :-

    select d1.serverid, d1.jobname,convert(char(11),d1.procdate) 'date' , max(procdate)'max_procdate'

    from disjobevt d1

    where convert(char(11),d1.procdate) in (select convert(char(11),d2.procdate) from disjobevt d2

    where d1.serverid=d2.serverid

    and d1.jobname=d2.jobname

    )

    group by d1.serverid, d1.jobname...

  • RE: data transfer

    Hi,

    try using the Export data wizard, this can do multiple tables and if you can configure transformations for tables that have different columns. just right click on the database name...

  • RE: Select column by position in Select statement

    hi, try :-

    create table ABC (col1 int,

    col2 int, col3 int, col4 int, col5 int, col6 int, col7 int, col8 int, col9 int, col10 int, col11 int, col12 int)

    insert into...

  • RE: where does logins default database link stores?

    hi,

    use :-

    select name, dbname from master..syslogins

    order by name

    see syslogins in BOL

    HTH

    Paul

  • RE: Table Name as SP Parameter

    hi,

    very simple example to illustrate the point :-

    create procedure generic_select @table_name varchar(255), @field_name varchar(255)

    as

    declare @sqlstring varchar(8000)

    select @sqlstring = "select " + @field_name + " from " +...

  • RE: Stubborn records can't be deleted!.

    hi,

    have you tried setting the rowcount to delete a small number of rows (say 10) to see if that works ?

    Paul

  • RE: Exclude from transaction

    could you just put the audit info into audit table when a rollback occurs, effectively auditing the rollback ?

  • RE: Select Range Of Date

    hi, a very simple solution :-

    create table quarter_dates

    (start_date datetime, end_date datetime)

    insert into quarter_dates

    values ("April 1 2003", "June 30 2003")

    insert into quarter_dates

    values ("January 1 2003", "March 31 2003")

    declare @date datetime

    select...

  • RE: Select Range Of Date

    hi, a very simple solution :-

    create table quarter_dates

    (start_date datetime, end_date datetime)

    insert into quarter_dates

    values ("April 1 2003", "June 30 2003")

    insert into quarter_dates

    values ("January 1 2003", "March 31 2003")

    declare @date datetime

    select...

  • RE: whether the stored procedure can call itself?

    hi,

    seems that there's no techinal reason why not, but you need to be aware of @@nestlevel. if it reaches 32 the transaction is terminated. (see @@nestlevel in...

  • RE: Measuring CPU usage

    hi,

    hopefully the last one :-

    select cpu1.dt ,cpu1.spid ,cpu1.login_time ,cpu1.cumulative_cpu - cpu2.cumulative_cpu 'delta'

    from cpu_usage cpu1, cpu_usage cpu2

    where cpu1.dt > (select max(cpu3.dt) from cpu_usage cpu3 where cpu3.dt < cpu1.dt...

  • RE: Measuring CPU usage

    hi,

    try this new and improved version :-

    select cpu1.dt ,cpu1.spid ,cpu1.login_time ,cpu1.cumulative_cpu - cpu2.cumulative_cpu 'delta'

    from cpu_usage cpu1, cpu_usage cpu2

    where cpu1.dt > (select max(cpu3.dt) from cpu_usage cpu3 where...

  • RE: Measuring CPU usage

    hi,

    just change the order by to order by clause to :-

    cpu1.dt desc, cpu1.spid

    Paul

Viewing 15 posts - 106 through 120 (of 161 total)