Sql-server – SELECT * Returns 1 Record, But SELECT COUNT(*) Shows 3k+ Records

sql serversql server 2014

I imported a csv file that had more than 3k records into a database table in SQL Server using the Import Wizard. I do not receive any errors, and the import wizard shows success, with 3217 records imported. If I run the following statement, I get 3217 records: SELECT COUNT(*) FROM tbl. However, if I try SELECT * FROM tbl, only one record is returned. What's going on here?

Using SQL Server 2014 Management Studio.

Best Answer

So I figured this out less than a minute after I hit post, despite thinking about it and googling for a bit.

So the problem is that I ran a procedure earlier that deleting some duplicate values in a table using SET ROWCOUNT 1 and a WHILE loop. I realize that I didn't actually set rowcount back to zero (SET ROWCOUNT 0) after the break in the loop. After doing that, I can see all the records now.