MSSQL Examples #353
Replies: 9 comments 7 replies
-
Hello! But having at least one or two more complete mssql examples is a good idea and would be very welcome! Could you make a pull request ? |
Beta Was this translation helpful? Give feedback.
-
Thanks, I will make a pull request. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Merci!
Op di 2 jul 2024 om 15:48 schreef Ophir LOJKINE ***@***.***>:
… When you are in a case where RETURNING is actually used, you can use
OUTPUT
<https://learn.microsoft.com/en-us/sql/t-sql/queries/output-clause-transact-sql?view=sql-server-ver16>
instead. For instance:
UPDATE BasisAggregatsTypSET
Kurzname = 'NewKurzname',
Bezeichnung_DE = 'Neue Bezeichnung_DE',
Bezeichnung_EN = 'New Bezeichnung_EN',
Kommentar = 'New Kommentar',
GeaendertAm = GETDATE(),
GeaendertVon = 'UpdatedUser'WHERE AT_ID = $at_id_from_url;
OUTPUT
'redirect' as component,
CONCAT('/UI/BasisTypen/PageBasisAggregatsTyp.sql?old_name=', DELETED.Kurzname) AS link;
—
Reply to this email directly, view it on GitHub
<#353 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHS2S7FJKQFJR5NRQNHMGKTZKKVULAVCNFSM6AAAAABIQXU4J2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TSMZXGE3TM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Met vriendelijke groet,
Rick Hoek
Directeur
Tracy Data Solutions B.V.*|* ABC Westland 666/670 *|* 2685 DH Poeldijk *|*
Netherlands
*Ph:* +31 10 744 18 13 *|* *Mob:* +31 6 53 19 74 06 *|* *E: ***@***.***
*|* *I:* www.tracy.nu
Aan dit bericht kunnen geen rechten worden ontleend.
|
Beta Was this translation helpful? Give feedback.
-
Hi Ophir, I use MSSQL; This Code produces this error after parsing, so I
think that you should need to output the semi-colon too!
error returned from database: A MERGE statement must be terminated by a
semi-colon (;).
## Here is the code
```
MERGE INTO user_info AS target
USING (SELECT :username AS username, sqlpage.hash_password(:password) AS
password_hash) AS source
ON (target.username = source.username)
WHEN NOT MATCHED THEN
INSERT (username, password_hash)
VALUES (source.username, source.password_hash)
; --note that I provide the ";" here, but after prsing it is gone...
```
## This is after parsing:
Failed to execute SQL statement:
MERGE INTO user_info AS target USING (SELECT ***@***.*** AS VARCHAR(MAX)) AS
username, ***@***.*** AS VARCHAR(MAX)) AS password_hash) AS source ON
(target.username = source.username) WHEN NOT MATCHED THEN INSERT (username,
password_hash) VALUES (source.username, source.password_hash)
|
Beta Was this translation helpful? Give feedback.
-
User authentication demoThis example demonstrates how to handle user authentication with SQLpage. MSSQL versionIt is based on the original PostgreSQL database example, but now modified to be used with MSSQL. All the user and password management is done in SQLPage, Take note that the database is a little bit different:
This demonstrates how to implement:
User authentication is a complex topic, and you can follow the work on implementing differenet authentication methods in this issue. MSSQL filesindex.sql
login.sql
create_user.sql
create_user_welcome_message.sql
generate_password_hash.sql
logout.sql
protected_page.sql
signin.sql
signup.sql
|
Beta Was this translation helpful? Give feedback.
-
I added a new mssql-specific example to the list of examples: Microsoft SQL Server Forms |
Beta Was this translation helpful? Give feedback.
-
A great, thanks Ophir!
Slowly I am doing more and more with SQLPage combined with MSSQL and our
own TSQL.APP Framework
Have a look: https://ux1.nl/tsql_index/index.sql
And our movie on youtube is fun: https://www.youtube.com/watch?v=cdD3GYheq_w
[image: image.png]
[image: image.png]
Op vr 8 nov 2024 om 16:42 schreef Ophir LOJKINE ***@***.***>:
… I added a new mssql-specific example to the list of examples: Microsoft
SQL Server Forms
<https://github.com/sqlpage/SQLPage/tree/main/examples/microsoft%20sql%20server%20advanced%20forms>
—
Reply to this email directly, view it on GitHub
<#353 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHS2S7DA7DBGBHHJT35ZRHTZ7TLV5AVCNFSM6AAAAABIQXU4J2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMJZGA2TQMQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Met vriendelijke groet,
Rick Hoek
Directeur
Tracy Data Solutions B.V.*|* ABC Westland 666/670 *|* 2685 DH Poeldijk *|*
Netherlands
*Ph:* +31 10 744 18 13 *|* *Mob:* +31 6 53 19 74 06 *|* *E: ***@***.***
*|* *I:* www.tracy.nu
Aan dit bericht kunnen geen rechten worden ontleend.
|
Beta Was this translation helpful? Give feedback.
-
https://github.com/sqlpage/SQLPage/releases
Love your work and the fantastic tools and documentation!
With kind regards,
Rick
|
Beta Was this translation helpful? Give feedback.
-
Hi, Ophir
First of all, I love SQLPAGE, thanks for your great initiative!
My question is this: Would it be possible to create the examples for MSSQL too?
For example MSSQL does not have "RETURNING" like postgres does. It would be great if existing examples would also be available for the MSSQL dialect.
Beta Was this translation helpful? Give feedback.
All reactions