| Author | Topic | 
                            
                                    | Steel_mStarting Member
 
 
                                        25 Posts | 
                                            
                                            |  Posted - 2008-11-27 : 08:32:05 
 |  
                                            | Hi everybody. Having a little problem. I have 2 huge tables. And created a view to join a few feilds between the two. By problem is that i would like to know how to export this view to notepad. Its going to have about 1.5 million rows containg no more than 25 feilds. |  | 
       
                            
                       
                          
                            
                                    | sakets_2000Master Smack Fu Yak Hacker
 
 
                                    1472 Posts | 
                                        
                                          |  Posted - 2008-11-27 : 08:41:19 
 |  
                                          | Have you tried usingt bcp for this ? |  
                                          |  |  | 
                            
                       
                          
                            
                                    | Steel_mStarting Member
 
 
                                    25 Posts | 
                                        
                                          |  Posted - 2008-11-27 : 09:09:57 
 |  
                                          | I only see examples where they use bcp to export tables. How would i apply it to a view. |  
                                          |  |  | 
                            
                       
                          
                            
                                    | sodeepMaster Smack Fu Yak Hacker
 
 
                                    7174 Posts | 
                                        
                                          |  Posted - 2008-11-27 : 09:13:37 
 |  
                                          | Are you using SQL 7.0 or 6.5? I think 7.0 has export/Import wizard. You can put the query in it and export it to text files. You can do with bcp in 6.5. |  
                                          |  |  | 
                            
                       
                          
                            
                                    | sodeepMaster Smack Fu Yak Hacker
 
 
                                    7174 Posts | 
                                        
                                          |  Posted - 2008-11-27 : 09:23:06 
 |  
                                          | Put the body of view (SQL statements) in bcp. |  
                                          |  |  | 
                            
                       
                          
                            
                                    | Steel_mStarting Member
 
 
                                    25 Posts | 
                                        
                                          |  Posted - 2008-11-27 : 10:30:54 
 |  
                                          | 7.0. SO you saying my only option is to place the view in a table then do the export. Cas i only see the import/export option on tables. |  
                                          |  |  | 
                            
                       
                          
                            
                                    | sodeepMaster Smack Fu Yak Hacker
 
 
                                    7174 Posts | 
                                        
                                          |  Posted - 2008-11-27 : 10:33:03 
 |  
                                          | Put the query that is used in the view likeselect.....from so so join po po ......in  Export/Import wizard in the 7.0. |  
                                          |  |  | 
                            
                       
                          
                            
                                    | Steel_mStarting Member
 
 
                                    25 Posts | 
                                        
                                          |  Posted - 2008-11-27 : 10:34:22 
 |  
                                          | i read the syntax from msdn website but it is still a little unclear. The bcp method sounds like the way to go though, where would i put my view statment in the bcp ? |  
                                          |  |  | 
                            
                       
                          
                            
                                    | sodeepMaster Smack Fu Yak Hacker
 
 
                                    7174 Posts | 
                                        
                                          |  Posted - 2008-11-27 : 10:44:42 
 |  
                                          | Then use DTS packages.Suppose I have a view like:Create view dbo.vwdbasselect ......Then put above SQL Statement in green in Execute SQL taskand flat file destination . |  
                                          |  |  | 
                            
                       
                          
                            
                                    | Steel_mStarting Member
 
 
                                    25 Posts | 
                                        
                                          |  Posted - 2008-11-27 : 10:50:46 
 |  
                                          | hey, I tried putting the code for my view in the export using query and it worked. Thanks alot. I tried using about 10 rows. Hope i get the same result with 1 milion. |  
                                          |  |  | 
                            
                       
                          
                            
                                    | sodeepMaster Smack Fu Yak Hacker
 
 
                                    7174 Posts | 
                                        
                                          |  Posted - 2008-11-27 : 10:52:29 
 |  
                                          | It will work. Did you have Turkey ?   |  
                                          |  |  | 
                            
                       
                          
                            
                                    | Steel_mStarting Member
 
 
                                    25 Posts | 
                                        
                                          |  Posted - 2008-11-27 : 11:07:53 
 |  
                                          | I will have to wait until christmas . We dont celebrate thanks giving in the caribbean. |  
                                          |  |  | 
                            
                            
                                |  |