MSSQL Get the date from DateTime
Tech-Today

MSSQL Get the date from DateTime


This is how you will get the Date object from DateTime

SELECT CONVERT(nvarchar(20), GETDATE(), 23) AS DateOnly

For more MSSQL Convert Codes you can refer here:
http://www.dbforums.com/microsoft-sql-server/1621868-what-format-codes-mean-sql-convert.html




- Create A Custom Json String Deserializer In Java
On normal cases we really have a lot of ways in doing so, we can use jaxb, jackson and more. But in some cases we really need to improvised, for example in the project I'm working right now I have a date string from a .net application in this format:...

- Calling Mssql's Aspnet_membership_createuser Stored Procedure
Here's how you would want to call mssql's aspnet_Membership_CreateUser method: DECLARE @return_value int, @UserId uniqueidentifier, @nowUtc datetime, @now datetime set @nowUtc = getutcdate() set @now = getdate() EXEC @return_value = [dbo].[aspnet_Membership_CreateUser]...

- Insert An Md5 Password In Mssql
To md5 a string in mssql we execute this query: select HASHBYTES('MD5', 'password') //But this has a problem because it returns a VarBinary data type which is a garbled text. So it should be converted first to NVarchar: SELECT CONVERT(NVARCHAR(32),HashBytes('MD5',...

- C# Converting A Date To Timestamp And How To Create An Md5 Function
A always use these 2 methods so I'm gonna paste them here. I don't remember if I change some lines in these code but I'm sure I got them from Microsoft hmmm already forget about it. DateTime -> TimeStamp /// /// method for converting a System.DateTime...

- Sqlce Get Last Insert Id, Convert Sqldecimal To Int32
Platform: Windows Mobile, SqlCE2.0 Problem: You want to get the id of the last query you insert. Solution: Using the @@identity you have to execute your queries like this: SqlCeConnection conn = null; try { conn = new SqlCeConnection(GetConnection());...



Tech-Today








.