Forum Replies Created

Viewing 15 posts - 91 through 105 (of 137 total)

  • RE: SELECT TOP problem

    If you want to change the number of rows returned each time by passing in a parameter, you will have to use SET ROWCOUNT instead of TOP. SET ROWCOUNT will...

  • RE: Pad varchar with leading zeros

    If you want a generic function you could do it like this:

     
    
    SET field_name = RIGHT(REPLICATE('0',5) + field_name,5)

    -Dan

  • RE: Table variable or Temparary table (tempdb)

    Another option if you don't want to convert all sub-procs to user-defined table functions, is to still use a temp table, but only reference it in the main proc. ...

  • RE: Incorrect query cost percentage in exec. plan

    Currently I'm using OPENQUERY, like this (ugly, I know):

    (SELECT * FROM OPENQUERY(SERVER1, 'SELECT Client_ID, Ult_Client_ID=db1.dbo.fn_Get_Ultimate_Parent_ID(Client_ID,default) FROM db1.dbo.Client_Master'))

    -Dan

  • RE: Incorrect query cost percentage in exec. plan

    I believe the value to be totally incorrect, here's why:

    My stored proc is a procedure used to search a large database, but it also does a few remote queries in...

  • RE: OPENQUERY and parameters

    FYI... just another tidbit of info. It works if I use a hardcoded paramenter:

    SELECT * FROM OPENQUERY(SERVER2, 'SELECT val1=db1.dbo.fn_MyFunction(21)')
    

    -Dan

  • RE: examples of large databases

    FYI, I think Terraserver is running mulitple 1.5+ terrabyte databases.

    -Dan

  • RE: DTS or BCP or ???

    You can launch the proc regularly by scheduling as a job. Using the Enterprise Manager: Management-->SQL Server Agent-->Jobs-->New Job...

    -Dan

  • RE: BCP queryout question

    I don't believe there is any parameter on bcp that will allow you to do that. Like Simon noted, you would have to do it manually.

    -Dan

  • RE: SSQL PROCEDURE

    I would check to see if the value has been inserted yet, before you do the insert statement. Something like this:

     
    
    IF NOT EXISTS (SELECT...
  • RE: 192GB Snapshot - How long?

    I have done transactional replication on a 40gb database. I initialized the subscription server using a snapshot. I took about 8-9 hours to transfer the data. I...

  • RE: select distnict problem

    If it's a hidden char, then that is difficult to detect, maybe try this:

    
    
    select distinct statename
    from states
    where state not like '%[^A-Z ]%'...
  • RE: Deadlock detection

    Here is a simple proc that we wrote to watch blocking in the server...we just called it "x" so it's quick to type:

    
    
    CREATE PROC x
    ...
  • RE: Where are all the Replication books?!

    Thanks all...and Paul, I'm actually enrolled in a Dec. 2591 course. Glad to hear it's worth the time.

    -Dan

  • RE: select distnict problem

    select distinct statename

    from states

    where ISNULL(LTRIM(RTRIM(state)),'') != ''

    -Dan

Viewing 15 posts - 91 through 105 (of 137 total)