How to execute multiple statements in SQL Server and return a temporary table after a select query

Source: Internet
Author: User
Set ANSI_NULLS on
go  
SET quoted_identifier in
go  
-=============================================  
CREATE FUNCTION CSJ_CSJ (@id as int)  
RETURNS @temp Table                    --here returns a table of its own creation, where the fields are set according to their needs  
(  
  [id] int,    
  [ZD] varchar (m),   
  [XL] varchar ( As
BEGIN
          
    insert INTO @temp select ID,ZD,XL from Deb-   -Inserts the SQL statement from the query into a temporary table, noting that the field is consistent  
          
    Return    --don't forget to return here, or not to inquire!  
End
Go

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/database/SQLServer/

Related Article

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.