Skip to content

Commit f48ce6e

Browse files
authored
Example for user defined functions.
1 parent 3c668c7 commit f48ce6e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,20 @@ VALUES
3939
SET IDENTITY_INSERT Person.AddressType OFF
4040
```
4141

42+
**Table-valued and inline user defined functions are supported**
43+
```
44+
EXECUTE dbo.GenerateInsert @ObjectName='dbo.ufnGetContactInformation', @FunctionParameters='(1)'
45+
, @TargetObjectName='MyContactInfo';
46+
```
47+
This will generate the following script:
48+
```
49+
SET NOCOUNT ON
50+
INSERT INTO MyContactInfo
51+
([PersonID],[FirstName],[LastName],[JobTitle],[BusinessEntityType])
52+
VALUES
53+
(1,N'Ken',N'Sánchez',N'Chief Executive Officer',N'Employee')
54+
```
55+
4256
### Example using SELECT syntax ###
4357

4458
```
@@ -148,3 +162,6 @@ END
148162
CLOSE TableCursor;
149163
DEALLOCATE TableCursor;
150164
```
165+
166+
#### Wall of Appreciation ####
167+
If you would like to express your gratitude to this project do not hesitate to make a pull request to https://github.com/drumsta/sql-generate-insert/blob/master/THANKS.md

0 commit comments

Comments
 (0)