March 31, 2009 at 1:56 am
Hi,
i m using Sql server 2005.and i want to extract data from reporting db by using Views only
and it will return Millions of Records.
like example : Select * from xyz_view
what should be the approach i will follow to do this ????
thanks in advance
mohit....:-)
March 31, 2009 at 4:35 am
You may need to filter the data. Include a WHERE clause to limit the amount of information you're getting back.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
March 31, 2009 at 4:43 am
hi,
actually i wanted to know that while writing views what appraoch i take ,
like using of flat tables, using left joins for non-mandedory fields aur what??
there is no UI in it, we have to run qyery directly on DataBase.
March 31, 2009 at 4:53 am
There's nothing all that special about a view. It's just a query that sort of behaves like it was a table. If you need to move data out of the system in a particular form, yes you can use views (but don't join views against views or select views from views, that creates a lot of problems) or procedures or direct queries against the system.
As to which joins or which columns to include, that really depends on the structure, the data, and the business needs of the system that you're feeding data into. Knowing nothing about your system, I couldn't recommend using an OUTER JOIN over an INNER JOIN, the INNER JOIN could be the right way to go.
When moving all the data out of a system you might be better off looking to use SQLCMD as a way to move the data in bulk.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
March 31, 2009 at 9:58 am
When moving all the data out of a system you might be better off looking to use SQLCMD as a way to move the data in bulk.
... or bcp utility.
Greets
Flo
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply