I need to run a sql script in a 2sxc visual query.
I can do "where portalid = 709"
But, to use this in any portal, how do I automatically the the PortalId into the script?
Use the token [Portal:PortalId]
in your sql ;)
For other token examples, like [QueryString:xyz]
see https://docs.2sxc.org/api/dot-net/ToSic.Eav.DataSources.Sql.html