I have a date field [load_date] and a datetime2 field [load_time] that I want to combine into a datetime2.  I want to combine load_date with the time portion of load_time and create a datetime2.  It's in an existing table, and I want to SET the load_time to this new value.  Below is a SELECT that appears to work, so I can turn this into an UPDATE statement.  However, I wanted to know if there is a more elegant or less verbose way.  SELECT     [load_date]     , [load_time]     , DATEADD(DAY, DATEDIFF(DAY, CAST(CAST([load_time] AS TIME) AS DATETIME2), CAST([load_date] AS DATETIME2)), CAST(CAST([load_time] AS TIME) AS DATETIME2))
Given the following components  DECLARE @D DATE = '2013-10-13' DECLARE @T TIME(7) = '23:59:59.9999999'   What is the best way of combining them to produce a DATETIME2(7) result with value '2013-10-13 23:59:59.9999999'?  Some things which don't work are listed below.    SELECT @D + @T       Operand data type date is invalid for add operator.     SELECT CAST(@D AS DATETIME2(7)) + @T       Operand data type datetime2 is invalid for add operator.     SELECT DATEADD(NANOSECOND,DATEDIFF(NANOSECOND,CAST('00:00:00.0000000' AS TIME),@T),@D)      The datediff function resulted in an overflow. The number of dateparts   separating two date/time instances is too large. Try to use datediff   with a less precise datepart.   * The overflow can be avoided in Azure SQL Database and SQL Server 2016, using .    SELECT CAST(@D AS DATETIME) + @T       The data types datetime and time are incompatible in the add operator.     SELECT CAST(@D AS DATETIME) + CAST(@T AS DATETIME)      Returns a result but loses precision 2013-10-13 23:59:59.997
What does template  mean? How to concatenate text from multiple rows into a single text string in SQL server? How to solve this ode $xy''-(1+x)y'+y=x^2$? When does System.gc() do something? degree of freedom of a rigid body 5 or 6? I'm confused here. I have a three particle (rigid) system. What would be the degree of freedom? I found out five. 3 coordinates for center of mass and 2 for describing orientation. But we have only three constraints, i.e. three equations that reduce 9 coordinates by 3, 9 - 3 = 6, which gives 6 degrees of freedom?? Did I miss something above? "All of the ...." or " All the ... "? Strange bug with "MessageName[a,b] is not of the form symbol::name ", Debugger & cursor location Recently a few friends and I came up with an idea for an app. To facilitate the creation of it, we set up LAMP on an Ubuntu Server 12.04. This box is running from my home. We've set up 3 user accounts. I'm still pretty new to Linux, but I have a bit of experience from using Ubuntu on my own box.  Today I was playing around with SSH and looking at the logs (I need to learn how to read that information to know how the server is performing, right?) and I saw the strangest thing.  In /var/log/auth.log and /var/log/auth.log.1 I saw a bunch of failed login attempts for 'root' and a few usernames I'm not familiar with. I looked over them and for as far as I can see no user has been authenticated except for the actual users on the system. A lot of the IP-addresses listed seem to be from Russia.  As of now this server contains nothing but a vanilla Ubuntu Server with LAMP, but even so, with the following command:  sudo grep -i fail /var/log/auth.log | wc -l   I get 3412 as a result. This seems very excessive for a server that has been up since April 8th. It gets worse, because running the above command on auth.log.1 returns 23075 (!!!!) results.  It seems obvious that people are trying to break into the server. Not that it contains anything of value, but once we start making progress on the app we wouldn't want our intellectual property stolen.  Should I be worried? And what can I do about it?  EDIT:  I found some very useful information  and this allowed me to run a script that splits and sorts all the invalid passwords and invalid users that tried to log in. May come in handy to someone who ended up here through Google! How to install driver for TP-Link TL-WN722N(EU)V2 on Ubuntu 17.04 Kylin I can not install the TP-LINK WN722N V2, which includes a 8188 EUS chip. Then I tried to install the backports v4.4.2,but   do not want to recognize either.  The TP-Link driver installation errors thrown out:  man@kman-livve:~$ cd '/home/kman/Documents/Tplink 722 N V2/rtl8188EUS_linux_v4.3.0.8_13968.20150417' kman@kman-livve:~/Documents/Tplink ...$ sudo make  "******************************************" "NO SKRC,we will use default KSRC" "******************************************" make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.10.0-15-generic/build M=/home/kman/Documents/Tplink 722 N V2/rtl8188EUS_linux_v4.3.0.8_13968.20150417  modules make[1]: Entering directory '/usr/src/linux-headers-4.10.0-15-generic' arch/x86/Makefile:140: CONFIG_X86_X32 enabled but no binutils support make[1]: *** No rule to make target '722'.  Stop. make[1]: Leaving directory '/usr/src/linux-headers-4.10.0-15-generic' Makefile:1367: recipe for target 'modules' failed   A method to know him, I do not know about. Thanks  Model:TL-WN722N(EU)_V2_161112_Linux.zip Chipset:rtl8188EUS_linux_v4.3.0.8_13 Selecting all objects that have been specified in Modifiers Could anyone help in making a script for selecting all objects that are specified in the different modifiers that an object has stacked? For example if my object has a Boolean modifier and an Array modifier, which both refer to an empty or another object (in the Array modifier there is for example an Object offset you can specify). Would it be possible to select all those object with one click? Thanks. Is it possible to Pivot data using LINQ? Is there a way to exclude other particle systems from the effects of a Wind effect? I have a scene with a number of particle systems. I'd like to have a separate wind effect for my main scene and another for an extra: an emitter + wind-effect to blow leaves into my scene. I can't find any way to exclude, so here I am. At the very worst, I can just render the main scene and then render the wind effect and composite it, but I figured I'd check first. Regular cast vs. static_cast vs. dynamic_cast Standard definition of graph says that it is an ordered pair G=(N,L) where N is set of nodes and L is set of lines which connect the nodes.   From what I've read, the set L can be empty, but can set N be empty too?  I'm mainly asking this because for my exam, I found numerous problems that go like this: Graph X is given. How many subgraphs with property Y exist? Often the number depends on the definition of graph. Generator expressions vs. list comprehensions When should you use generator expressions and when should you use list comprehensions in Python?  # Generator expression (x*2 for x in range(256))  # List comprehension [x*2 for x in range(256)] To EAV or not to EAV? Is it possible to write all mathematical formulas in a separate file and add them in main file on-demand? How will the super massive black hole affect our galaxy? Basis of the null space Find the basis of the null space for the matrix  $$D = \begin{bmatrix}0 &amp; 0 &amp; 0 &amp; 0\\0 &amp; 1 &amp; 1 &amp; 0\\1 &amp; 1 &amp; 0 &amp; 0\\1 &amp;1 &amp; 0 &amp; 0\end{bmatrix}.$$  I computed the solution by letting eigenvectors $(x,y,z,w)$ such that $y+z=0,x+y=0$, and I got a basis vector $\{(1,-1,1,0), (0,0,0,1)\}$ . But from one textbook  I have found the solution as $\{(1,0,0,0),(0,0,1,1)\}$. May I made a mistake? Thanks! Jquery - change event firing on page load