Monday, July 22, 2013

[T-SQL] Unique Field

[T-SQL] Unique Field


Unique Field

Posted: 21 Jul 2013 02:18 PM PDT

How to Retrieve A Field That is unique in two tables?

[HELP] FOR XML

Posted: 21 Jul 2013 09:16 PM PDT

Hi All,I need use SQL (for xml) to write in this customize format of XML as below:<track_n_trace tranid="1234" ordernum="ABC123"> <current_location>MY</current_location> <status code="OK" reason_code="FINE"> <remark>KUU1234</remark> </status> <consignment_number>A5555</consignment_number> <total_shipped overall_qty="0" box_qty="0"/></track_n_trace>

Hi Please help to resolve this Problem: Advance Thanks for given Solution

Posted: 21 Jul 2013 03:31 PM PDT

Table1:Reportid | IdetityID(Pimary key)-------- | ---------2 | 12 22 32 42 5Table2:Reportid | IdetityID(Primary key)-------- | ---------3 | 13 | 23 | 33 43 5I want to insert above values in to Table3 leke below:Hear Problem is i want to give relations ship above Table1 and Table2 Primary keys Reference to TABLE3 Forigen key Identity Column.Is there any posibility give me solution Table3:Reportid IdetityID(Forigen key)-------- ---------3 13 23 33 43 52 12 22 32 42 5

Date Validations?

Posted: 21 Jul 2013 08:52 PM PDT

How To Validate a year, month,and date and totaldate?Year should be in yyyy format,month should be between 1 and 1 to 12 and date should be between 1 to 31 and total date should be YYYY-MM-DD Formate?Plase guys share your ideas?

Substring takes 100%CPU

Posted: 21 Jul 2013 04:43 AM PDT

SELECT CASE WHEN substring(column_name, 1, 2) = '44' THEN column_name ELSE '44' + column_name END 'column_name', min(col2) 'date' FROM DBNAME..TABLENAME(nolock) WHERE col3 = '1' and col4 not in('447404000130','7404000130') group by CASE WHEN substring(column_name, 1, 2) = '44' THEN column_name ELSE '44' + column_name END

No comments:

Post a Comment

Search This Blog