Oh ok. I understand what you're saying. However, I need that file name in
order to really name my uniquely named files since all of these files are
stored in the same directory. Hence, I'm relying on the unique IDENTITY to
make my file names unique as well. It's for auditing purposes too so that I
have the exact file name stored in that field instead so that my audit
programs simply look at that complete file name instead of having to do any
business programming on concatenating that file name with the identity to
get the true file name. I also need to deal with different file extensions.
With your idea, I would need to store another column for file extension but
i would hope to avoid that and simply store the complete name of the file in
> > Exactly. However, I need to know the identity column value upon the
> > query execution.
> My point was that there's no reason to duplicate the data that's in the
> table. Why have an ID of 322 in 2 places, especially when it requires a
> more complex INSERT?
> You can do as follows, when you actually need to "build" a filename at
> time (NOT at insert time):
> SELECT filename_Field+CONVERT(varchar(10),IDENTITY_FIELD) as Filename...
> Instead of this:
> SELECT filename_Field as Filename...
> And then you don't have to worry about (a) redundant data, which requires
> more storage space, and (b) more complex insert operations.
> The FAQ has a new look. http://www.aspfaq.com/
> > > Why not just concatenate the filename and identity columns at query