Monday, March 19, 2012
Controlling Sa
is it possible to control the sa login , so that he cannot view a specific table. is it possible
regds
ramsa has access to everything. why do you wish to prevent the sa from having access to a table?
Controlling process priority in SQL Server 2000 - possible..?
A similar question has been asked in a different thread, but didn't get a conclusive answer. Is there a way to set process priority on a specific process (alternatively - processes started by a specific user), similar to what the Task Manager allows in Windows?
I need to archive some data from an OLTP database. Unfortunately, some of the tables are growing rather large, and copying the data, and especially removing it based on record age, is a resource-intensive operation. My database must be available 24/7, and I can't have queries timing out, or I start losing business real fast. I was thinking of firing off the archive script and setting the process priority on it to something lower than normal, so it won't interfere with my OLTP processes.
Maybe someone can suggest a better solution?
Rather than trying to change the process priority, you might want to write a T-SQL cursor that selects a subset of the data that you want to archive, then loops through the cursor, possible with a one second delay each time, to move or delete the data. This will allow you to better control the impact on your main system.|||Glenn, good point. I was actually thinking of doing both, if that was possible. I won't be able to run a copy-and-delete operation on something like 40 million rows in one shot anyhow - I'll run out of RAM. SO a cursow was going to happen regardless. But it chews up CPU. The RAM I can release by using explicit transactions for each cursor iteration, but I don't see what I can do about the CPU. The delay would help, but I have constant "write" access to the very tables that need to be archived, and I am afraid that I'll still have service interruptions unless I can lower the process priority.Sunday, February 12, 2012
Constant table size?
I've got a bunch of reports that have very specific formatting requirements (not mine, industry standards). Basically I need to have different headers and footers on each page, so I don't think I can use the report's headers and footers. Instead I'd like to use each table's (one for each page) set of headers and footers. This is fine for getting the data in there, but I'd like the table footer to be forced to be at the bottom of the page because having a footer halfway down just looks bad.
To summarize, is it possible to have a table footer be in the same place on a page (almost) regardless of how many rows there are returned.
pg1 pg2
header header
data data
data
footer footer
I'd prefer not to split each page into a different report and use those footers, so if there are any other hacks out there I'd really appreciate it
Thanks, JeffWell I do have an ugly way: add enough rows (of the data row's height) to the table footer to put the footer in the right position. Then add an expression to each one's visibility to toggle the first one off when 2 data rows are returned, and toggle the second when 3 data rows are returned, etc.
Any neater, less intensive ideas?
-Jeff
Constant scan when querying an identity field over linked server
specific identity value, SQL Server performs a constant scan instead of a
remote query. Running the same query locally gives expected results. Also,
forcing a data type conversion in the criteria gives expected results.
Example problematic query:
Select MyID
From Server2.MyDB.dbo.MyTable
Where MyID = 1
0 records are returned, but a record with a MyID = 1 does exist.
The following works as expected:
Select MyID
From Server2.MyDB.dbo.MyTable
Where MyID Like 1
Select MyID
From Server2.MyDB.dbo.MyTable
Where Cast(MyID As varchar) = 1
Any ideas as to why this is happening and how to permanently prevent it?
Thanks!!In case i wasn't clear on this point, it only happens when the criteria is
checking an identity field. Another other field works as expected.
"Robert Davis" wrote:
> When I perform a simple query over a linked server that is looking for a
> specific identity value, SQL Server performs a constant scan instead of a
> remote query. Running the same query locally gives expected results. Also,
> forcing a data type conversion in the criteria gives expected results.
> Example problematic query:
> Select MyID
> From Server2.MyDB.dbo.MyTable
> Where MyID = 1
> 0 records are returned, but a record with a MyID = 1 does exist.
> The following works as expected:
> Select MyID
> From Server2.MyDB.dbo.MyTable
> Where MyID Like 1
> Select MyID
> From Server2.MyDB.dbo.MyTable
> Where Cast(MyID As varchar) = 1
> Any ideas as to why this is happening and how to permanently prevent it?
> Thanks!!
>|||Look at the provider properties for the OLE DB provider you are using for
this linked server; they are sensitive to this attributes and they are
global, meaning they will affect all linked servers and remote queries using
this provider.
Sincerely,
Anthony Thomas
"Robert Davis" <RobertDavis@.discussions.microsoft.com> wrote in message
news:4B3A73A3-D24B-479B-9799-ADBC9054BAAB@.microsoft.com...
In case i wasn't clear on this point, it only happens when the criteria is
checking an identity field. Another other field works as expected.
"Robert Davis" wrote:
> When I perform a simple query over a linked server that is looking for a
> specific identity value, SQL Server performs a constant scan instead of a
> remote query. Running the same query locally gives expected results. Also,
> forcing a data type conversion in the criteria gives expected results.
> Example problematic query:
> Select MyID
> From Server2.MyDB.dbo.MyTable
> Where MyID = 1
> 0 records are returned, but a record with a MyID = 1 does exist.
> The following works as expected:
> Select MyID
> From Server2.MyDB.dbo.MyTable
> Where MyID Like 1
> Select MyID
> From Server2.MyDB.dbo.MyTable
> Where Cast(MyID As varchar) = 1
> Any ideas as to why this is happening and how to permanently prevent it?
> Thanks!!
>|||Robert .. or anyone
Did you mange to resolve this issue and if so what was the solution?
Thanks
Chris Longstaf
-
chopperto
----
Posted via http://www.webservertalk.co
----
View this thread: http://www.webservertalk.com/message555779.htm