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.
Author |
Topic |
Volkof
Starting Member
14 Posts |
Posted - 2014-10-23 : 03:50:59
|
Hello,I'm sure this is very simple, especially for an experience user. I have the following problem:I imported a table with 4500 rows but SQL imported also extra 500 rows with the value NULL. The table looks like this: ID Customer ...4500 4501 Alex4501 NULL NULL...........................Problem is that i can't change the data type, set primary key etc.How can I solve this?Many thanks |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-10-23 : 09:55:02
|
Use SSIS to do the import. |
|
|
Volkof
Starting Member
14 Posts |
Posted - 2014-10-23 : 10:53:47
|
But is there a way to delete the NULL rows?Thanks. |
|
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-10-23 : 11:05:38
|
sure! In SSIS, use a conditional split transformation and only send non-null rows to the destination (excel) transformation |
|
|
AASC
Starting Member
24 Posts |
Posted - 2014-10-24 : 17:16:32
|
There is also a way to achieve this-------------------Delete All Rows with NullDELETE ---SELECT *FROM TableName WHERE CustomerID IS NULL -------------------Reset Idenity Column ValueDECLARE @MaxID INTSET @MaxID= (SELECT MAX(CustomerID) FROM TableName)DBCC CHECKIDENT ('dbo.TableName', RESEED, @MaxID); |
|
|
|
|
|