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...
Stop, before you do anything, read this!
http://www.sqlservercentral.com/columnists/kKellenberger/removingthebuiltinadministratorssomepitfallstoavoi.asp
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...
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...
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...
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...
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...
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...
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!
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.