select statement working unexpectedly

大兔子大兔子 提交于 2019-12-25 02:43:23

问题


when i click SELECT TOP 1000 row from table then it only shows some records like 3 records

but when i manually run query on same table then it shows all records like many 1000s records which i always want.

Select * from dbo.HrEmployee

why ? Help please, i'm using SQL SERVER 2012


回答1:


It look like you have created two copies of the same database, the one is in the “intended” database and the second has been created in the master database. 3 records were then inserted into the intended table and the rest were inserted into the master.dbo.HrEmployee.

When you use the select top 1000 you are running the query against the correct database even though it only has 3 records and when you run the second query you are running it against the same table in Master



来源:https://stackoverflow.com/questions/21349391/select-statement-working-unexpectedly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!