Forum Replies Created

Viewing 15 posts - 136 through 150 (of 268 total)

  • RE: Count(*) Question

    sp_spaceused can also give the "possible innaccurate" value from sysindexes,

    unless the paramter @updateusage is set true.

    The belief that count(*) is bad practice and that you should use count(0) or...

  • RE: Can this be done without cursors?

    -- No cursors please

    set nocount on

    create table #scores( person char(10) not null, grp int not null, result int not null,

     primary key(person,grp) )

    insert #scores(person,grp,result)

    select...

  • RE: It is possible to call a stored procedure belonging to different database?

    You still have the same security context if you use qualified names.

    specifying owner.object does not override your current security context for that object.

    Using qualified names will tell sql server exectly...

  • RE: insert value

    After You have completed this task you will want to set the column to NOT NULL, and perhaps DEFAULT = -1.

    ALTER TABLE myTable ALTER COLUMN myColumn INT NOT NULL

    ALTER TABLE myTable...

  • RE: It is possible to call a stored procedure belonging to different database?

    Best practice is to fully qualify your names:

    owner.name in same database,

    databse.owner.name for calling into another database.

    iof: " ...from dbA..TableA... "

    better: " ...from dbA.dbo.TableA... "´

    /rockmoose

  • RE: EXEC and sp_executesql

    EXEC myStoredProcedure @prm1 = 6, @prm2 = 7

    So Sql Server has to find out that you are executing a stored procedure ?

    EXEC( 'EXEC myStoredProcedure @prm1 = 6, @prm2 = 7'...

  • RE: Break down update statement

    Why left join ???,

    I think that is where the performance hit is.

    You could rewrite sql like this:

    UPDATE email_status_master

    SET global_opt_out_ind = 1

    FROM email_log l(nolock)

    WHERE l.consumer_id = email_status_master.consumer_id

    l.email_type_cd = 1

    and email_status_master.email_sent_date...

  • RE: EXEC and sp_executesql

    There is no gotcha to not using sp_executesql or exec() afaik.

    This is the way to do it, a parameter in a sp.

    Imo a sp is more flexibe than using sp_executesql.

    /rockmoose

  • RE: sp_executesql with large query Str

    Yup,

    Good luck with your query string..

    A common error (for me anyway) with long generated sql strings/scripts is to forget a space or to have a comma too much/little somewhere.

    You...

  • RE: sp_executesql with large query Str

    Hi,

    It seems that string varchar(8000) + string varchar(8000) is still equal to 8000.

    Yes, that is true, adding two varchar(8000) will result in varchar(8000).

    This shouldn't affect the beavior of execute(...

  • RE: Incremental updating without duplicating data?

    Some of our transaction systems use this technique. For example when a customers bill is adjusted, a new "credit" record is added which negates the first one, and then a...

  • RE: Incremental updating without duplicating data?

    Hi,

    Do You have "incremental update filters" ? - see in BOL.

    When Analysis Services does an incremental update, it does not not

    update changed records, it only reads new records into the...

  • RE: SQL to get customer shopping trends

    Hi,

    You did not leave much to go on schemawise.

    Maybe You could do it in the following way:

    Retrieve 2 customer sets,

    one with all the mall customers, and one with all the...

  • RE: inserting random records

    Glad to be of help

    Keep practicing...

    /rockmosse

  • RE: inserting random records

    create table #randomphonenumbers( nmbr char(10) primary key )

    declare @digits table(nr char(1))

    insert @digits(nr) select '0' union select '2' union select '4' union select '6' union select '8'

    insert @digits(nr) select nr+1 from...

Viewing 15 posts - 136 through 150 (of 268 total)