Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Creating a user friendly form that generates a SQL

Author  Topic 

geissap
Starting Member

2 Posts

Posted - 2012-06-14 : 15:38:45
I'm wondering if there is an easy way to create a form that would output a SQL script into a text file. We often have to add users using a SQL script. We have the script written out and it just sits in text file as a template to use and then we essentially go in and add everything we need to add our user. I'm wondering if there's a form that I could create where we could just enter in our two ID's, last name and first name, check boxes for what facilities the users need access to and it would just automatically generate the script. Anyone have recommendations on what to use to do this?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-14 : 16:07:25
Show us the script so we can help.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

geissap
Starting Member

2 Posts

Posted - 2012-06-14 : 16:28:19
INSERT INTO VGN_PRVDR (PRVDR_SER_ID,PRVDR_ID,PRVDR_FAC_ID,PRVDR_LST_NM,PRVDR_FRST_NM,PRVDR_PRMY_SPCTLY,PRVDR_INSRT_TS)
values (1234567,'12345','010','KENNEDY','JOHN',NULL,CURRENT_TIMESTAMP);

That's the basic script. So essentially when we add a user they usually are added to multiple facilities (Which is represented by the "010" in the script above. So essentially I'd now have to copy and paste that line 5 or 6 times and just change the facility code. I'd ideally like a form where I could just enter in the SER ID, PRVDR ID, LAST NAME, FIRST NAME and then click the check boxes of what facilities that user needs to be added to and BAM! It'd just write all the lines of code to a text file.

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-14 : 16:51:28
There is nothing built-in to do this. You would need to code that form.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -