Hello Folks,
I want to create a simple batch DOS script to query mi SQL Server 2000 database. How I could do this?
I just want to run a select for a table but I dont want people to interct with sql query analyzer or enterprise manager to avoid any issues.
Regards,Look up OSQL or ISQL in Books Online.
Basically:
OSQL -S <name of your server/instance> -U <UID> -P <PWD> -d <Database to use> -Q"<your select statment>" -n -b
I do this all the time so post back if you have more questions.|||Originally posted by Paul Young
Look up OSQL or ISQL in Books Online.
Basically:
OSQL -S <name of your server/instance> -U <UID> -P <PWD> -d <Database to use> -Q"<your select statment>" -n -b
I do this all the time so post back if you have more questions.
UID stands for? PWD I assume is the pasword, isnt.
How I can redirect the results to a txt file,
OSQL -S OSQL -S <name of your server/instance> -U <UID> -P <PWD> -d <Database to use> -Q"<your select statment>" -n -b >> query.txt
Am I right?
Thanks for your prompt reply and help|||UID = User ID
You could pipe the output to a text file but the -o parm would be more usefull.|||How I can get the instance name. I have tested in my environment and I got the next error:
[DBNETLIB] Sql Server does not exist or access denied
[DBNETLIB] ConnectionOpen <Connect(())
As per this result I checked the server name I used typing osql -L. I got the names and used them but with the same result.
When I open the Sql query analyzer I connect using windows authentication option to connect to my databases.
Please suggest..|||For Windows Security I think you need to use -E option instead of -U and -P options.
Tim Ssql
Showing posts with label thisi. Show all posts
Showing posts with label thisi. Show all posts
Friday, March 30, 2012
Monday, March 26, 2012
Invalid object name 'tsvw_
Hi Everyone!
Is someone here can help me on this?
I receive a error when inserting or Updating row in a replicated table
the error is Invalid object name 'tsvw_*****
What to do with this
Sorry, here some more
I'm using MSDE version of SQL 2000, and 3 layer merge replication, on a WAN
|||when you say three layers, do you mean you have a republishing scenario? "tsvw_*" is a view used by merge replication, my guess is that it may have been dropped somewhere during your setup. If you're doing a republishing scenario, make sure you set up A to B first, then republish B to C.
Subscribe to:
Posts (Atom)