如何在sql中为一个id保存多个路径? [英] How to save multiple paths for one id in sql?

查看:134
本文介绍了如何在sql中为一个id保存多个路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个客户端,我想在一个clientId中上传多个文件,以便该特定客户端可以下载上传的文件!

如何在数据库中为一个特定客户端保存多个路径???

I have multiple clients and i want to upload multiple files in one clientId, So that that particular client can download the uploaded file!
how do i save multiple path in the database for one particular client???

推荐答案

设置一个表来保存文件路径 - 它需要三列:

Set up a table to hold the file paths - it needs three columns:
ID - primary key. Into is probably fine, as is Identity
CustomerId - type matches that in customer table and is a foreign key
Path - nvarchar





我可能会添加一个OriginalFileName和一个VersionNumber字段,并将文件存储在Guid名称而不是原始名称(因此不同的客户可以更容易地使用相同名称的不同文件。



然后通过搜索客户来检索文件。



I would probably add an OriginalFileName and a VersionNumber field, and store the file under a Guid name rather than the original name (so it's easier for different customers to have different files with the same name.

You then retrieve the files by searching for the customer is.


这篇关于如何在sql中为一个id保存多个路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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