如何编写SQL存储过程以从存储过程中获取前n个记录?
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
Provider = new CookieAuthenticationProvider
{
// Enables the application to validate the security stamp when the user logs in.
// This is a security feature which is used when you change a password or add an external login to your account.
OnValidateIdentity = validate
}
});
我收到了一个错误:
'@Sum'附近的语法不正确
答案 0 :(得分:4)
根据错误,看起来您正在使用SQL Server。
您需要将@Sum
括在括号中:
SELECT TOP (@Sum) *
FROM Customer