Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: icemel
  • Order by date
  1. icemel

    Configuring db access for certain users - best practises

    There are both built-in SERVER roles (such as sysadmin) and DATABASE roles (such as db_reader/writer). Consult Books Online for descriptions of each type of role. These built-in roles are good for assigning "broad" privileges to users. For example, assigning someone a db_reader role for a given...
  2. icemel

    builtin\administrators

    Stop, before you do anything, read this! http://www.sqlservercentral.com/columnists/kKellenberger/removingthebuiltinadministratorssomepitfallstoavoi.asp
  3. icemel

    Complex date problem - help

    DateFirst is 7 by default in English... which works for us... but thanks for the tip - sp_helplanguage is good to know.
  4. icemel

    Complex date problem - help

    Hi George, Sorry I should have saved you the effort of writing all that out - I just ran each section and saw the results and figured it out. But I'm sure other people will benefit from this explanation. Very cool. The fact that you can utilize the weekday number to do math makes this a...
  5. icemel

    Complex date problem - help

    Hi George, Yes, I find this part confusing: Set @RunDate = DATEADD(dd, DATEDIFF(dd, 0, @RunDate), 0) Select @EndDate = @RunDate + 1 - DatePart(Weekday, @RunDate) Select @StartDate = @EndDate - 7 Thanks!
  6. icemel

    Complex date problem - help

    Wow, I think this actually works! I'll have to take a look at it more closely to understand it, but this could solve the problem. THANKS VERY MUCH
  7. icemel

    Complex date problem - help

    Hi, Here's my problem: Need to run weekly reports every Monday or Tuesday. However, regardless of which day we run the report on, it has to calculate sums of sales figures for the previous week starting on the previous SUNDAY. So if we run the report today, June 27th, I need the sales figures...
  8. icemel

    Date question

    found it - SELECT DATEADD(dd, DATEDIFF(dd, 0, GETDATE()), 0)
  9. icemel

    Date question

    Hi, Thanks for eveyone's help so far... it's been very helpful! My question now is this... I have a query that needs to find all the records that are within a certain time frame, see below: WHERE effectiveDate >= GETDATE()-7 and effectiveDate <= GETDATE() The problem is, GETDATE() starts at...
  10. icemel

    More cursor questions...

    So, from what I gather, it is faster to use a temp table or table variable than use a cursor? I guess I would have to test it. Thanks
  11. icemel

    More cursor questions...

    Below is an excerpt from an article from SQL-Server-Performance.com. They sound like good ideas. However, they give no examples of how to transform a cursor using these methods. I suppose I should use my imagination. Is there someone who can illustrate an example of how to use each method...
  12. icemel

    CURSOR QUESTION

    Thanks for your response. At this point, we are not going to remove any of our cursors. So, what I need to find out is, the most efficient way to run the cursors. So far, it looks like "forward_only" and "static" are most efficient, but then it looks like many factors can play into it, for...
  13. icemel

    CURSOR QUESTION

    There is no output variable in this sp. Select @Output As CommaListOfEmails Not sure what the above is for?
  14. icemel

    CURSOR QUESTION

    The only reason we would ever use cursors is to process data row by row when the processing can't be done on an entire result set. Sometimes this can't be avoided. Here's an example: FETCH NEXT FROM #email_cursor INTO @name, @email WHILE @@FETCH_STATUS = 0 BEGIN IF @Header = '' SET...
  15. icemel

    CURSOR QUESTION

    well, i answered my own question forward_only with static makes it static so my question now is, is there any performance benefit to making a cursor forward_only (provided scrolling is not needed) thanks!
  16. icemel

    CURSOR QUESTION

    Hi, I have a question about cursors. A "Forward_Only" cursor reflects changes to the underlying data, and does not use tempdb. A "Static" cursor does *not* reflect changes to the underlying data and *does* use tempdb. So, my question is, if you declare a cursor as: CURSOR LOCAL FORWARD_ONLY...
  17. icemel

    create SQL scripts for reinstallation

    Please clarify "reinstall your SQL from scratch". That's pretty ambiguous.
  18. icemel

    SQL database question

    do the backup again, choose overwrite option i think that will do it? the database backup (not the database) doubled in size because you appended it

Part and Inventory Search

Back
Top