Showing posts with label single. Show all posts
Showing posts with label single. Show all posts

Thursday, March 29, 2012

Filter Expression

Hi

I have some data that need to be filtered based on a SET of Id's.
If it's about a single ID, then i would pass it as a parameter in a
stored procedure and use it within the the WHERE Clause, but here those
ID's are determined in run time and I can't simply create a a stored
procedure for an unknown amount of ID's.
I looked into the SQL Server 8.0 Manual but had no examples how to use
the Function Filter.
Generaly, how can filter some records based on a set of ID's?

Best regardscoosa (coosa76@.gmail.com) writes:
> I have some data that need to be filtered based on a SET of Id's.
> If it's about a single ID, then i would pass it as a parameter in a
> stored procedure and use it within the the WHERE Clause, but here those
> ID's are determined in run time and I can't simply create a a stored
> procedure for an unknown amount of ID's.
> I looked into the SQL Server 8.0 Manual but had no examples how to use
> the Function Filter.
> Generaly, how can filter some records based on a set of ID's?

FROM tbl t
JOIN iter_intlist_to_tbl(@.list_of_ids, DEFAULT) f ON t.id = f.number

iter_intlist_to_tbl is table-valued function that unpacks a space-
separared list of integers into table which you then join with.

Code at http://www.sommarskog.se/arrays-in-...ist-of-integers.
The rest of the article provides more discussion about this kind of problem.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Monday, March 26, 2012

FillFactor considerations

I have a table with about 200 million rows of data. I add a couple million rows of data each week to the table in a single load process. The table is used for reporting purposes only and there are never (not intentionally at least) any updates or deletes to the table. The data is always being added to the "end" of the table with the new AsOfDate being the main factor in the clustered index.

My question is this: Since I'm not "inserting" rows that would split pages, should I have my FILLFACTOR for the table set to 100, or am I missing something? I obviously want to save physical hard drive space, but I also don't want to slow down the import process.

BTW, I'm using SQL2000

If you are certain that your data loads is 'always' putting the new data at the end of the clustered index, you may have a good case for NOT leaving empty space on the data pages -and a FILLFACTOR of 100 would be in order.

Fill in page

Hello,

My current reports are too large for printing but good for viewing. Can I set some parameters to fill reports in single page by width?

Thanks

Are you asking if you can have a report dynamically shrink so it always fits on a single page? If so, the answer is no.

You can set the page height or width in the Report Properties dialog box.

Wednesday, March 21, 2012

Filegroups question

Hello everyone -

Currently the setup is a single filegroup sql machine
with each company as a new database in a single system.

Would breaking the companies into thier own filegroups
be benefitial?

or perhaps creating a instance of SQL for each company be a better approach?

thoughts / ideas would be appreciated

thanks
tonyWould breaking the companies into thier own filegroups
be benefitial?

Only if those filegroups reside on different actual drives, you might gain the performance benefit of different companies not impacting eachother performance.

or perhaps creating a instance of SQL for each company be a better approach?

Only if you have given the customer sysadmin or someother sql server wide access which I would sincerely discourage. That way the differrent customers could not access eachothers stuff.|||Thanks for the reply

I appreciate it!

take care
tony