Question: I want to create an 'attach' button as in gmail that when clicking on it, a browse window will open, and upon a user choice, an http request will be sent to the server.

Today I'm using the following code in the client:

```
<form action="/upload" method="post" enctype="multipart/form-data">
                        <input type="file" name="data" />
                        <input type="submit">do it</input>
</form>

```

This is not good for a couple of reasons: 

1. I do not want a submit button to send the files to the server, I want it to be triggered when 
the file is chosen by the user.
2. The form default action behavior is to send the user to a different page

I'm looking for an implementation (native angular code, not an external library) of an http post request with the same details (`enctype="multipart/form-data"` and the file details) but without using a form.

Answer: 
As far as SQL Server is concerned there is no difference in this case - both the implicit (no CAST) and explicit conversion will produce the same result.

However, from a code maintenance point of view there is a slight difference. The implicit conversion is just another line of code, probably (based on my experience, no reflection on you!) without any comments or documentation or anything else. The explicit conversion in the same place also says "the person who wrote this code knows that GETDATE returns a DATETIME but they don't want the TIME part so are deliberately just saving it into a DATE". 

It's not making one line more maintainable that counts, it's taking the approach to all of your work that makes a difference in the long run.

Rhys
The example you gave is what is called an "implicit conversion". In otherwords SQL Server guesses the best way to convert it. These conversions are on a [pretty diagram on MSDN](http://msdn.microsoft.com/en-GB/library/ms187928.aspx). As SQL Server will do it implicitly, there is no need for you to do it explicitly. You are just adding noise. 

Personally i like to do the minimum amount of date manipulation possible. Otherwise what you tend to find is people casting them all over the place causing code smells.

If you need the time portion and are consequently storing the time, you can format-away the time in the UI if required.

If you find you need queries that are creating WHERE clauses on your date with a time, consider separating the date and the time into separate fields to prevent SEARCHARGs i.e. developers wrapping functions around your indexed columns in the where clause which prevents the optimizer from using the index, therefore reducing performance.