Information générale
Forum:
Microsoft SQL Server
Excellent.
Thank you. This is exactly what we were looking for.
>No, my script below uses Windows Authentication, that's the -E parameter. I believe it's optional, if you don't pass in username and password, osql should try using Windows Authentication.
>
>To pass in username and password, use -U and -P parameters.
>
>Roman
>
>
>>Do you need to pass in user id and password into osql?
>>
>>>You can use the osql utility, you can read about it in BOL. It allows you to execute SQL commands, including contents of a file. Here is an example, I use this to back a database on development server, copy the backup file to my computer and then restore the database on my local server:
>>>
>>>osql -S devweb2 -d master -E -i "C:\Projects\COM\Backup\BackupPerson01.sql"
>>>copy J:\comPerson.BAK c:\projects\com\backup
>>>osql -S ltrehak -d master -E -i "C:\Projects\COM\Backup\RestorePersonDB.sql"
>>>
>>>If you do it this way, you don't need an executable as long as SQL Server Client Tools are installed and it's easy to make modifications because all you need to do is to edit the batch file or SQL files.
>>>
>>>Roman
>>>
>>>
>>>>I've got a program that generates one script file and mutliple text files that will be bulk imported from the query analyzer. I need to wrap all of this into an exe that a user can run with a simple double click of an icon. I'm not sure how to proceed.
>>>>
>>>>Any help or suggestions you can give me would be greatly appreciated.
>>>>
>>>>TIA
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement