Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts

Saturday, March 5, 2011

CRUD using XML and XQuery

we have a table TestA with 2 columns (ID,Name) and ID is an identity column.

Saturday, October 16, 2010

Sending multiple values in XML to database from application and parse using XQuery in SQL Server 2005

SQL Server 2005 has XML support, it means we can process XML on database side. There are some scenarios that we want to insert, update or delete multiple rows or send some different values to the database, one way is using delimited values and then on database side, we have to parse that string to retrieve the values, another way is using XML to send data to database, then in the stored procedure we can use XQuery and easily parse that XML.(the names are all case sensitive)

Wednesday, July 28, 2010

How to get only date part in T-sql DateTime

SELECT DATEADD(D, 0, DATEDIFF(D, 0, GETDATE()))

OR

SELECT CONVERT(DATETIME, FLOOR( CONVERT(FLOAT, GETDATE())))