Obtain the CID domicile Location Based on the ID card number

Source: Internet
Author: User

The first version is rough

 

Http://blog.csdn.net/happyflystone/archive/2008/07/23/2700649.aspx

 

This record is detailed and forms are stored in the database.

 

Friends who need it can download and use it from my resources.

Http://download.csdn.net/user/happyflystone

 

Actually, there is no technical content

 

  1. ------------------------------------
  2. -- Author: flystone
  3. -- Version: v1.001
  4. -- Date: 2008-08-04 21:56:11
  5. -- Reprinted and indicated the source
  6. ------------------------------------
  7. Alter function f_getinfo (@ CID varchar (18 ))
  8. Returns varchar (100)
  9. As
  10. Begin
  11. -- No legality check
  12. Declare @ s varchar (100)
  13. Select @ s = isnull (@ s,'') +CaseWhen demo-='Region'Then'' ElseDemo-end
  14. From sfz_info
  15. Where dm = left (@ CID, 2) +'123'Or dm = left (@ CID, 4) +'00'Or dm = left (@ CID, 6)
  16. Order by DM
  17. Return@ S
  18. End
  19. Go
  20. Select DBO. f_getinfo ('123')
  21. /*
  22. Bytes ----------------------------------------------------------------------------------------------------
  23. Yanqing County, Beijing
  24. (The number of affected rows is 1)
  25. */
  26. Select DBO. f_getinfo ('123')
  27. /*
  28. Bytes ----------------------------------------------------------------------------------------------------
  29. Xicheng District, Beijing
  30. (The number of affected rows is 1)
  31. */
  32. Select DBO. f_getinfo ('123')
  33. /*
  34. Bytes ----------------------------------------------------------------------------------------------------
  35. Jinzhou Miao and Dong Autonomous County, HuaiHua City, Hunan Province
  36. (The number of affected rows is 1)
  37. */

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.