简体   繁体   English

Getdate() 函数在 SQL Server 2014 Express 中不起作用

[英]Getdate() function does not work in SQL Server 2014 Express

I am a newbie to programming.我是编程的新手。 I downloaded the free version of SQL Server 2014, the Express edition.我下载了 SQL Server 2014 的免费版本,即 Express 版。 Somehow the Getdate() function is not working.不知何故Getdate()函数不起作用。 It says它说

Incorrect syntax near '('. '(' 附近的语法不正确。

If I just say GETDATE .如果我只是说GETDATE It says它说

Could not find stored procedure 'GETDATE'.找不到存储过程“GETDATE”。

Can someone tell me if some library is missing from my installation?有人可以告诉我安装中是否缺少某些库吗?

I tried reinstalling the software assuming that some libraries were missing.假设缺少某些库,我尝试重新安装软件。

getdate() is what I am trying. getdate()是我正在尝试的。 Even the Datepart() and any of the date functions does not work.甚至Datepart()和任何日期函数都不起作用。

Could you please help me to resolve the above issues and guide on the correct syntax?你能帮我解决上述问题并指导正确的语法吗?

要做到这一点,您需要添加select

SELECT GETDATE()

GETDATE() is a function , you need to close the parentheses and add SELECT clause. GETDATE()是一个function ,您需要关闭括号并添加SELECT子句。

Type SELECT GETDATE();输入SELECT GETDATE();

And check the oficial docs: GETDATE (Transact-SQL)并查看官方文档: GETDATE (Transact-SQL)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM