Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Import in SSMS

Author  Topic 

psangeetha
Yak Posting Veteran

95 Posts

Posted - 2010-04-21 : 10:59:51
Hi all,

I'm importing few tables using SSMS import wizard from Excel. Import fails for all the rows currently because of some bad rows in Excel. I'm trying to find out if there is a setting in the import wizard to filter all the bad rows and just import the good rows into the table?

Thanks

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2010-04-21 : 11:47:34
You have the option in the wizard to write a query that will filter out "bad" rows, if there's a rule that can determine what makes a row bad.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

psangeetha
Yak Posting Veteran

95 Posts

Posted - 2010-04-21 : 12:45:50
Thanks so much..

But, if I'm importing from Excel how can I write a query to filter the bad rows? Do I write a select statement or insert statement?

Thanks again
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2010-04-21 : 13:18:09
A select statement. Name the range you wish to import from excel and use that name like a table
SELECT <this stuff>
FROM NamedRangeInExcel
WHERE <these records are good>

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
   

- Advertisement -