code_junkie

Set Locale of a SQL Server 2005

Nov 11th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. Dim dc As New SqlCommand("INSERT INTO hello VALUES (@Date)", cn)
  2. dc.Parameters.Add(New SqlParameter("Date", System.DateTime.Now))
  3.  
  4. INSERT INTO hello VALUES convert(datetime, @Date + ' 00:00:00', 103)
  5.  
  6. INSERT INTO hello VALUES convert(datetime, @Date, 103)
  7.  
  8. SELECT myColumn FROM myTable WHERE myDateField >= convert(datetime, @Date + '00:00:00', 103)
Add Comment
Please, Sign In to add comment