I have 90 scripts in C:\SQL Scripts\*sql
how could i execute by command ,i saw many things on net but could execute it successfully,,,
I am using sql 2008 R2 , not a default instance
19 2584 Rabbit 12,516
Recognized Expert Moderator MVP
You can run this from the command line: - for %f in (*.sql) do sqlcmd /S <servername> /d <dbname> /E /i "%f"
I installed SQL multiScripts software ,, trial version
NeoPa 32,557
Recognized Expert Moderator MVP
@Rabbit
Does your SQLCMD command cover the fact that the SQL Server is not running as the default instance?
@Waqar100
If you ask for assistance you should respond to when someone posts that help. If you have chosen to use special software to handle this in spite of standard software being available, and help for that given to you, surely you can explain why. Otherwise it seems like you have just ignored the expert whom you asked to help you.
Rabbit 12,516
Recognized Expert Moderator MVP
@NeoPa, oh, I'm not sure. If it doesn't there's probably a switch for it.
NeoPa 32,557
Recognized Expert Moderator MVP Rabbit:
If it doesn't there's probably a switch for it.
That's cheating! :-D
OK. I looked it up myself ( Connect to the Database Engine With sqlcmd). The syntax would be : - for %f in (*.sql) do sqlcmd /S <servername>\<instancename> /d <dbname> /E /i "%f"
I am using this command,this will halt at. - for %f in (*.sql) do sqlcmd /S <WAQAR-PC>\<KARACHI20882>/d <SF_CORE_DEV_CMD> /E /i "%f"
See the image http://postimg.org/image/6g76k7lax/
Now what should i do?
NeoPa 32,557
Recognized Expert Moderator MVP
<servername>\<instancename> = WAQAR-PC\KARACHI20882 and there is a space before the /d.
Try that and let us know how you get on.
Thanks Neo Pa
Now i am stucking at this stage , what should i do the next. http://postimg.org/image/l4k0bv6hl/
FYI: i have temporary i am testing on only 3 files a t this location
say 3 scripts in c folder
Path=C:\FOlder and they are respectively 1.sql, 2.sql and 3.sql.
Rabbit 12,516
Recognized Expert Moderator MVP
Please attach the image to the thread itself.
which image @Rabbit? I didnt understand.
Rabbit 12,516
Recognized Expert Moderator MVP
You attached an link to an image. Our firewalls block external file storage sites.
Thanks Neo Pa
Now i am stucking at this stage , what should i do the next. http://postimg.org/image/l4k0bv6hl/
FYI: i have temporary i am testing on only 3 files a t this location
say 3 scripts in c folder
Path=C:\FOlder and they are respectively 1.sql, 2.sql and 3.sql.
Now the link of above image is
Now it is ok?
Rabbit 12,516
Recognized Expert Moderator MVP
That's too small to read. But it looks like a command prompt. So just type in the thread itself what the command prompt is showing.
There are 2 snaps I attached of the different extension.if you are able to see then tell me the next steps.3 sql files are in C,, see the previous detail of this path.
Rabbit 12,516
Recognized Expert Moderator MVP
It's too small for me to read. It's just command prompts, there's no need for screenshots, just type what it says in the thread.
I typed already,& the issue is at the image,
Rabbit 12,516
Recognized Expert Moderator MVP
I already said I can't read the text in the image. Type the text in the image into the thread itself.
Oralloy 988
Recognized Expert Contributor
Waqar100,
remove the "<" and ">" from your command.
It should probably read: - 1.for %f in (*.sql) do sqlcmd /S WAQAR-PC\KARACHI20882 /d SF_CORE_DEV_CMD /E /i "%f"
c:\>for %f in (*.sql) do sqlcmd /S <servername> /d <dbname> /E /i "%f"
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Phil Grimpo |
last post by:
I had previously explained this problem in a different thread, but now that
I have an IISState log, I figured I'd re-start the thred. My situation and
the log are following...
I have a very odd...
|
by: Mr. x |
last post by:
Hello,
Where can I find many scripts for the developing on dotnet ?
Thanks :)
|
by: Eitan |
last post by:
Hello,
Where can I find good forums that includes many scripts for .net ?
Thanks :)
|
by: Crash |
last post by:
Hi,
..NET v1.x SP1
VS 2003
SQL Server 2000 SP3
Server 2000, XP, Server 2003
I would like to programmatically execute {possibly many} SQL Server
batch scripts. Aka I have many scripts that...
|
by: Dave Hughes |
last post by:
Just noticed something rather annoying after upgrading my test box (a
Linux server running DB2 UDB v8 for LUW) to fixpak 11 (for reference it
was previously on fixpak 7).
In the past I've relied...
| |
by: szukteam |
last post by:
I'm very new to java- as a matter of fact, I'd say that I know nothing about it....except for how to cut and paste free java script to my pages.
I have the need for three different slide shows on...
|
by: robert.waters |
last post by:
Hello,
Do you need to close an adodb recordset returned from a
connection.execute(SQL) action?
ex)
set rcd = con.execute("SELECT * FROM TABLENAME")
I know that close()ing objects that you...
|
by: Michael |
last post by:
I'm new to PHP.
Evidently my ISP's server does not recognize <?php ... ?>, but it does
recognize <script language="php"... </script>, which would imply
that <?php ... ?is not portable.
If in...
|
by: Avaenuha |
last post by:
I'm teaching myself UNIX, here, and I've written a shellscript that works fine if I use it while in the /bin directory, but if I try to use it from another directory, I get 'command not found'.
...
|
by: simplicity |
last post by:
This is erratic and not always reproducible.
I have a large amount of data (SOAP) that I must parse and every one
in a while, especially on slower machines the warning pops up about
too many...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |