Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

running a SQL script

 
   Database Help (Home) -> MSEQ RSS
Next:  Has anyone had any luck getting PDO_IBM to work?  
Author Message
Jackie

External


Since: Oct 15, 2008
Posts: 1



(Msg. 1) Posted: Wed Oct 15, 2008 1:50 pm
Post subject: running a SQL script
Archived from groups: microsoft>public>sqlserver>mseq (more info?)

We have a program running on the SQL 2005 database platform. One of the
tables has too many indexes to do an ODBC call from Access, so the programmer
wrote a script that will drop some of the indexes so that I can link to it.

It has been years and years since I've run a SQL script on the database ...
and I can't remember how to do it. I can't get anyone from the software
company that gave me the script to tell me how to run it. Can someone please
tell me how to do it?

 >> Stay informed about: running a SQL script 
Back to top
Login to vote
Russell Fields

External


Since: Jan 10, 2008
Posts: 608



(Msg. 2) Posted: Thu Oct 16, 2008 8:49 am
Post subject: Re: running a SQL script [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jackie,

With SQL 2005 you can use SQLCMD (new) or OSQL (still supported) to run a
script. These are installed when you install the SQL Server management
tools.

sqlcmd -S servername -E -i scriptfilename -o outputfilename

The -E is telling sqlcmd to run with your rights. If you have to run as a
SQL Server login, then

sqlcmd -S servername -U loginname -P password -i scriptfilename -o
outputfilename

If you want to know more about the utility, the other options are describe
in the SQL Server Books Online.
Tutorial, if you need it:
http://msdn.microsoft.com/en-us/library/ms170207(SQL.90).aspx
Documentation: http://msdn.microsoft.com/en-us/library/ms162773(SQL.90).aspx


RLF



"Jackie" wrote in message

> We have a program running on the SQL 2005 database platform. One of the
> tables has too many indexes to do an ODBC call from Access, so the
> programmer
> wrote a script that will drop some of the indexes so that I can link to
> it.
>
> It has been years and years since I've run a SQL script on the database
> ...
> and I can't remember how to do it. I can't get anyone from the software
> company that gave me the script to tell me how to run it. Can someone
> please
> tell me how to do it?

 >> Stay informed about: running a SQL script 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Running a Update query based on information from Insert Qu.. - I am trying to setup a script where I run an insert query to insert information into a table. The first part I have down pat as far as the Insert, where I'm having difficulties is that the information is coming from an outside source and the input..

Script to Change FK Property NotForReplication across many.. - I am trying to change setting ”NotForreplication” across all FKs. However so far the only option is to drop each FK by name and recreate it. I was looking to create a script that goes through all FK and does the change. I am running SQL 2000,...

index on a view - Hello, I have a table (TAB) and A View with alias (VIEW) Table cod varchar 3 descr carchar 60 my view cod alias COd1 descr alias DES Now i need a index on view with key COD1 I can't create it. Can..

Creating an alias - I have an alias that can get very long because it maintains a information of where it came from. Is there a way to alias an alias? My first thought was: Declare @T1 varchar(128) Set T1 = 'MyAlias' .... Inner Join Table1 as @T1 This of course does no...

Formatting numeric fields in select-clause - This is propably a very simple question, but I can´t seem to find the answer to it in the documentation. I want to format a numeric field so the result is right justified and zero-filled. ex select 1 will give the result 01 How do I manage this..
   Database Help (Home) -> MSEQ All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]