Monday, March 18, 2013

Quick Tips

1. GUID Using SQL Server




You can generate a GUID using SQL Server using the following T-SQL statement:

[code] SELECT newid()[/code]

This statement generates a new GUID and displays it in the output window.

2. Get current time after removing special characters


[code]

SELECT REPLACE(CONVERT(VARCHAR, GETDATE(), 14),':','')

[/code]

Above code will return '221320687' for date '2013-03-19 22:13:20.687'

3. Converting strings to dates in derived column component: SSIS


Convert from yyyymmdd to date data type

4. Cmd Prompt : Shortcuts: ssms, sqlwb - did they confused you yet?


Check following link to clerify:

http://www.silverlighthack.com/post/2008/08/02/sql-server-2008-quick-fact-new-ssms-shortcut.aspx

[code]
(DT_DBTIMESTAMP)(SUBSTRING([date string], 1, 4) + "-" SUBSTRING([date string], 5, 2) + "-" + SUBSTRING([date string], 7, 2))
[/code]

4. difference between look up and merge join -- SSIS


http://consultingblogs.emc.com/jamiethomson/archive/2005/10/21/SSIS_3A00_-A-case-study-of-using-LOOKUPs-instead-of-MERGE-JOINs.aspx

http://beyondrelational.com/modules/2/blogs/106/Posts/14438/ssis-playing-around-with-lookup-and-merge-join.aspx

 

No comments: