Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregate Functions not Scripted #214

Open
VivianDZ opened this issue Aug 25, 2023 · 3 comments
Open

Aggregate Functions not Scripted #214

VivianDZ opened this issue Aug 25, 2023 · 3 comments

Comments

@VivianDZ
Copy link

Hi - I just noticed Aggregate functions are not being scripted when I run the script command. Is there any specific way to do this?

@keith-hall
Copy link
Contributor

The first thing to check, is does your aggregate function appear in the output of https://github.com/sethreno/schemazen/blob/master/Library/Models/Database.cs#L553-L571?

@VivianDZ
Copy link
Author

Hi - It doesn't show in the Query above. It does exist in the sys.objects table though (but not in sys.sql_modules).

image

One thing to add is both are CLR Aggregate functions.

image

@keith-hall
Copy link
Contributor

keith-hall commented Sep 29, 2023

Probably it will make sense for schemazen to have a separate model for aggregates. The syntax for reference is https://learn.microsoft.com/en-us/sql/t-sql/statements/create-aggregate-transact-sql?view=sql-server-ver16#syntax. There's an example C# project linked to at the bottom of the page which can be used for easy testing.
Schemazen already supports CLR assemblies, so hopefully not too hard to add... https://github.com/sethreno/schemazen/blob/master/Library/Models/Assembly.cs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants