BookmarkSubscribeRSS Feed
ssmiley96
Calcite | Level 5

I have a process flow that queries a SQL db and can generate a data set that will be written to another SQL db. I'd like to add a primary key or at the very least, a unique index, such that when my SQL table is loaded, it will reference the pk. 

 

Is this possible? If so, can it be done in Query Builder or do I have to add that syntax in proc sql?

1 REPLY 1
SASKiwi
PROC Star

Adding a primary key to an external database will require syntax specific to the SQL language used by that database. You will need to use SQL passthru and the SQL EXECUTE statement, so it will require a coded solution.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 731 views
  • 0 likes
  • 2 in conversation