有与SQL Server NewId()函数等效的Access吗? [英] Is there an Access equivalent of the SQL Server NewId() function?

查看:77
本文介绍了有与SQL Server NewId()函数等效的Access吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经编写了将数据加载到SQL Server数据库中的SQL语句(存储在文本文档中).这些陈述需要每天重复.有些语句使用NewId()函数来填充数据库中的键控字段,这可以很好地工作.在编写用于复制这些语句的应用程序的过程中,我想使用Access查询和宏,而不是将查询复制和粘贴到SQL Server中,从而每天节省了时间.一切正常,但我找不到任何可以替代SQL NewId()函数的函数.是否存在或正在解决?我正在使用SQL Server 2005和Access 2007.

I have written SQL statements (stored in a text document) that load data into a SQL Server database. These statements need to be repeated daily. Some of the statements use the NewId() function to populate a keyed field in the database, and this works fine. While I'm in the process of writing an application to replicate these statements, I want to use Access queries and macros instead of copying and pasting queries into SQL Server, thus saving me time on a daily basis. All is working fine but I can't find any function that will replace the SQL NewId() function. Does one exist or is there a work around? I'm using SQL Server 2005 and Access 2007.

推荐答案

在Matt的答案之上,您只需使用

On top of matt's answer, you could simply use a pass-through query and just use your existing, working queries from MS Access.

这篇关于有与SQL Server NewId()函数等效的Access吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆