Getting Started with Adobe After Effects - Part 6: Motion Blur
A collection of quick technology learning tips from what people around you learn every day

A new Conversion function in SQL Server Denali CTP3 - PARSE ()

Jul 26 2011 4:06AM by Paresh Prajapati   

PARSE() returns the result of an expression, translated to the requested data type. It takes three arguments, first parameter is stringvalue which will take nvarchar(4000) value. Second parameter is datatype which representing datatype requested for the result and third is culture which is optional which take a current language of session as default. passed string value must be valid representation for requested datatype otherwise PARSE() will throw error.

But here are some limitations of the datatype which can used for requested result.

In first example it parsing string value to datetime and bigint dataype and in second example parsing string value to numeric and datetime datatype and you can see the resulted output also.


SELECT PARSE('Monday, 13 December 2010' AS DATETIME) 
-- Valid parse 
-- Output : 2010-12-13 00:00:00.000

SELECT PARSE('Monday, 13 December 2010' AS BIGINT) 
-- Not valid parse 
--Msg 9819, Level 16, State 1, Line 1
--Error converting string value 'Monday, 13 December 2010' into data type bigint using culture ''.

SELECT PARSE('18' AS NUMERIC(18,2)) 
-- Valid parse 
-- 18.00

SELECT PARSE('18' AS DATETIME) 
-- Not valid parse 
--Msg 9819, Level 16, State 1, Line 1
--Error converting string value '18' into data type datetime using culture ''.

Read More..   [0 clicks]

Published under: SQL Server Tips ·  ·  ·  · 


Paresh Prajapati
6 · 22% · 7054
6
 
1
 
 
0
Incorrect
 
0
Interesting
 
0
Forgotten



Submit

1  Comments  

  • It is already available in dotnet

    commented on Jul 26 2011 5:12AM
    Kirti M.Darji
    10 · 16% · 4982

Your Comment


Sign Up or Login to post a comment.

"A new Conversion function in SQL Server Denali CTP3 - PARSE ()" rated 5 out of 5 by 6 readers
A new Conversion function in SQL Server Denali CTP3 - PARSE () , 5.0 out of 5 based on 6 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]