Well... I'm lazy, so - probably - i'd prefer to automate it via c# code. I'd create a programme wich will acts as you described in 2-3 and 5-8. I'd save final result in a text file (with .sql extension) and use it in SSMS window.
I guess I'm too lazy to write the program to do it
Having written such a program in the 90's for VB6, reworked for VB.net then for c# and now producing such things as WPF razor page templates and the CRUD stored procs I can relate to that. Except I start from the other end, create the tables in SSMS and then use ClassBuilder to do the bulk of the CRUD code.
Never underestimate the power of human stupidity -
I'm old. I know stuff - JSOP
Having been a developer for over 20 years, and a SQL DBA and Administrator since 6.5. My Preference is to design the database using Management Studio. I do it this way
#1. Design the raw tables include the fields for the Foreign keys BUT do not link them yet
#2. Design your Clustered indexes I will name them IDX_tablename
#3. Be lazy and use the Database Diagrams tool to define your Foreign Keys
My reason for doing this if the DB is designed correctly your app will be far more stable. If you design your foreign keys first it becomes your clustered indexes and normally you will cluster on a name or account number and not the ID.
Is there a command to select all text on console window screen?
I would like to copy the last screen of text on the console window and save in a text (.scr)file
Manually I use Alt + spacebar, E, S to select all and right click the mouse to copy.
I run a program in Visual Studio which displays in a console window.
Numerous times text is printed to the screen, used and cleared.
The last screen of text contains useful information, saved as a script file, and run in a CAD program to draw cabinets and parts.
Manual keyboard shortcuts work. A "command" to do the same function would be nice.
If this is your own program then write everything to a file as you read it or display on the screen. If it is an app that you do not have the source for then you can redirect all output to a file quite simply with the > operator.
Note that you can then read your own console output if need be (if you redirect to a file).
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
CTRL-A is supposed to select all text in a control or context in Windows. However, it doesn't seem to work in either the PowerShell window or Windows Terminal. I would be very curious about a solution as well.
Just did an experiment. I opened CMD.exe and CTRL-A worked. Then I typed powershell.exe and powershell opened in the CMD.exe window. CTRL-A no longer works. Exit powershell to CMD.exe and CTRL-A works again. So PowerShell is eating CTRL-A and not doing anything with it.
Wow you guys are fast.
This is my own program. I can look into using SendKey and TextWriter.
I might use TextWriter when I start to write the last screen of text or
possibly SendKey when the last screen is printed.
Sure appreciate it.
for console window, to select all, first set up your properties
Alt + spacebar (shows the dropdown menu)
P (to choose Properties)
Options tab- check Quick Edit Mode and Insert Mode
Alt + spacebar, E (for Edit), S (for Select All)
right click mouse (to copy to clipboard)
If you want to paste at command prompt- copy the command- in console window, right click to paste at command prompt.