Forum Replies Created

Viewing 15 posts - 76 through 90 (of 95 total)

  • RE: help in troubleshooting a stored proc

    You are checking for the existance of @tblnm..

    and dropping something else. I'm not sure thats what you're trying to do but...

    probably your error is here:

    select @drop_oldtbl = stuff(@tblnm...

  • RE: DTS Aborts With No Message

    I ran into this a while back..and could never find any info regarding this error. Just out of curiosity..whats the latest sp installed ?

    Matt

  • RE: return bottom 2 rows

    create table #foo

    (

    row_id int identity(1,1) primary key,

    word varchar(30)

    )

    go

    insert #foo(word)

    select 'hello'

    union all

    select 'goodbye'

    union all

    select 'how'

    union all

    select 'are'

    union all

    select 'you'

    go

    SELECT top 2 word from (select TOP 2 * FROM #foo order...

  • RE: copying sql jobs

    msdb should contain all your jobs

  • RE: autonumber

    Not sure if this is the best way to do it..but this works..

    select * into #store from {table}

    truncate {table}

    insert

    (non_id fields)

    select {non_id fields} from #store

    HTH

  • RE: Importing from Excel

    Here's somthing I wrote that may help you...I mispoke above ..you don't need to have a linked server to open an excel file from t-sql if you use openrowset or...

  • RE: ActiveX component can''''t create object: ''''Excel.Application''''

    Just a side to what Phil said..you just need excel.dll registered..

    Also you may want to check your permissions on the folder where the excel file resides..

    HTH

  • RE: Finding a zipcode

    try something like this...

    select * from

    (

    SELECT *, SQRT(POWER((38.492497-latitude),­2)+POWER((-121.404807-Longi­tude),2)) AS distance FROM location

    )q

    where q.distance < .16

    order by q.distance asc

    HTH

  • RE: Importing from Excel

    You can do this with open query as well, I believe.  You will need your dbas to create linked servers to the excel files.  Check the BOL on this.

     

    HTH

  • RE: Deleting the contents of a child table from a parent

    delete  parent

    from parent p

    join child c

    on c.all_fields = p.all_fields

     

    --tested below

    create table parent

    (

    p_id int identity(1,1) primary key,

    vala int,

    valb int

    )

    go

    create table child

    (

    p_id int identity(1,1) primary key,

    vala int,

    valb int

    )

    declare @int int

    set @int = 0

    while...

  • RE: Union Flaw

    Not sure I understand...

    Are you asking why you are receiving data in the main view even though category is NULL ?

     

    OR are you saying that you are not getting all...

  • RE: DTS Job Failure

    This is a trivial solution..but never hurts to check...

     

    Is there a field that is being populated with user data ?

     

    I had a similar result on a field that was being...

  • RE: SQL Server DB and Statistical Analysis

    Difficult but not impossile.  I created a database that does some six sigma analysis of data.

    It took about 4 months to get most of the kinks out..and you are right...

  • RE: SQL join

    id try something like this..

     

    go

    create table author_prec

    (

    author_prec_id int identity(1,1),

    rank int not null,

    contributor_id int not null,

    constraint AK_author_pred_rank Unique(rank),

    constraint FK_author_pred_cont_id foreign key(contributor_id)

    references contributor(contributor_id)

    )

    go

    --we rank authors so that the lowest rank will be...

  • RE: Trigger firing sequence

    You can use sp_settriggerorder to set the order in which a trigger is fired... 

     

    EXEC sp_settriggerorder <trigger name>, <order>, '<operation>'

     

    -- M Kulangara

Viewing 15 posts - 76 through 90 (of 95 total)