Can I create a One-Time-Use Function in a Script or Stored Procedure?

前端 未结 6 615
再見小時候
再見小時候 2020-12-24 11:04

In SQL Server 2005, is there a concept of a one-time-use, or local function declared inside of a SQL script or Stored Procedure? I\'d like to abstract away some complexity i

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-24 11:53

    Common Table Expressions let you define what are essentially views that last only within the scope of your select, insert, update and delete statements. Depending on what you need to do they can be terribly useful.

提交回复
热议问题