Having a table with this structure ...
Table_files
... Can I have a restriction that allows me not to duplicate the pair "file_name" + "file path" (but allows me to duplicate the "file_name" and "file path" separately), where the only Primary Key is the field "id_file" ?
thanks
Yes. Create an index for two fields and make it unique.
To go with what Guff said in his answer , create a unique index in two fields:
CREATE UNIQUE NONCLUSTERED INDEX IX_Table_files_name_path ON Table_files ( file_name,file_path ) GO
file_name+file_path, file_name file_path, .
file_name+file_path
file_name
file_path
Source: https://habr.com/ru/post/1720067/More articles:jQuery simple modal + asp.net - jqueryopenCV, combining the image with another image at the given coordinates - c ++redirecting to the homepage, not the 404 error page! - redirecthow to tessellate bezier triangles? - renderingExecuting sql file on SQL Server using C # - c #Failed to verify viewstate MAC address. when submitting a form using javascript - javascriptWPC TabControl с иконками переполнения - wpfEclipse: TextSelection plugin cannot be resolved - textselectionHow can I contract with an ASP.NET MVC project? - designRegEx matches comma separated numbers with optional decimal part - actionscriptAll Articles