在工作单中创建持续计数器 - 唯一 [英] Creating a sustaining counter as in work orders - unique

查看:60
本文介绍了在工作单中创建持续计数器 - 唯一的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨大家好,


我还是这个SQL的新手,并且有一个关于创建一个如果我放下临时表而不会重置的计数器的问题。这可能吗?我需要在每日订单表/视图/程序中添加新的工作订单号(计数器),我可以使其工作一天,但是当我删除临时表时,它会重置计数器。如何让Max(orderno)继续前进到第二天?


我对存储过程也很熟悉。我们目前正在办公室使用SQL 2000.


这个简单的意思gal的任何想法?


谢谢!

Jo

Hi Guys,

Im still new to this SQL stuff and have a question about creating a counter that does not reset if I drop the temp table. Is this possible? I need to add new work order number (counter) to a daily orders table/view/procedure and I can make it work for one day but then when I drop the temp table, it resets the counter back. How can I keep the Max(orderno) going forward to the next day?

I am a little versed in stored procedures too. We are using SQL 2000 at the moment in the office.

Any ideas for this simple minded gal?

Thanks!
Jo

推荐答案


嗨大家好,


Im仍然是这个SQL的新东西,并有一个关于创建一个如果我删除临时表不重置的计数器的问题。这可能吗?我需要在每日订单表/视图/程序中添加新的工作订单号(计数器),我可以使其工作一天,但是当我删除临时表时,它会重置计数器。如何让Max(orderno)继续前进到第二天?


我对存储过程也很熟悉。我们目前正在办公室使用SQL 2000.


这个简单的意思gal的任何想法?


谢谢!

Jo
Hi Guys,

Im still new to this SQL stuff and have a question about creating a counter that does not reset if I drop the temp table. Is this possible? I need to add new work order number (counter) to a daily orders table/view/procedure and I can make it work for one day but then when I drop the temp table, it resets the counter back. How can I keep the Max(orderno) going forward to the next day?

I am a little versed in stored procedures too. We are using SQL 2000 at the moment in the office.

Any ideas for this simple minded gal?

Thanks!
Jo



尝试IDENTITY列。它可能不是顺序的,但它是唯一的,它不会重置

try the IDENTITY column. it may not be sequential, but it''s unique and it will not reset



尝试IDENTITY列。它可能不是顺序的,但它是唯一的,它不会重置
try the IDENTITY column. it may not be sequential, but it''s unique and it will not reset



非常感谢您的回复!我确实尝试过Identity列,但我不明白如何在明天拉出存储过程时不重置它。我应该寄给你我的代码吗?也许我不应该创建表?如何在SELECT stmt中添加标识列?

Thank you so much for responding! I did try the Identity column but I dont know how to make it not reset when pulling the stored procedure tomorrow. Should I send you my code? Maybe I shouldnt create table? How can you put an identity column in a SELECT stmt?



非常感谢您的回复!我确实尝试过Identity列,但我不明白如何在明天拉出存储过程时不重置它。我应该寄给你我的代码吗?也许我不应该创建表?如何在SELECT stmt中放置标识列?
Thank you so much for responding! I did try the Identity column but I dont know how to make it not reset when pulling the stored procedure tomorrow. Should I send you my code? Maybe I shouldnt create table? How can you put an identity column in a SELECT stmt?



尝试发送您的代码...只需要那些

try sending your code... just those that will be needed


这篇关于在工作单中创建持续计数器 - 唯一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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