-3

My manager asked me to to compile a set of sql scripts, I use some of those scripts for updating new records (some are used in ssms and ssis), to create table and scripts that I use to connect the foreign keys from the dim table to the fact table.

He asked me to do this... Can you send me the sql script used to prepare the initial environment? Please put that into a executable .sql file.

I haven't done this before and what tools should I use? SSMS? or SSIS? or Notepad?

I am using SQL Server, the tools I have is SSMS and BIDS

7
  • possible duplicate of Export database schema into SQL file Commented Feb 18, 2014 at 1:25
  • What is your database server? Commented Feb 18, 2014 at 1:25
  • Hi, Im using SQL Server Commented Feb 18, 2014 at 1:26
  • 1
    A ".sql" file is just plain text containing the script. Commented Feb 18, 2014 at 1:27
  • There is no such thing as an executable SQL file Commented Feb 18, 2014 at 1:28

2 Answers 2

1

In SSMS, write a sql statement and save. It will create a txt document with an .sql extension. 'Excuting' this file will, depending on your file associations, open SSMS and load this file. As for sending a sql script used to prepare the initial environment, there is no such thing. That is something that you will have to prepare; we know nothing about your environment.

I have created SQL scripts that contain many steps to help me run repetitive tasks. Run it once and all of my work is done, but I built them painstakingly by hand one-at-a-time screenshot


screenshot

Sign up to request clarification or add additional context in comments.

Comments

1

The is no such thing as an "executable" SQL file. There are just SQL files:

Try something like this:

rename myscript.txt myscript.sql

Or if you are using an editor:

Save: myscript.sql

1 Comment

You are 'technically' write that there is no such thing as an 'executable' SQL file, but executable in this case may just mean verified "valid" or "working".

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.