cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

How to login to Ms SQL Server 2008 from Windchill Shell?

ptc-6026219
1-Visitor

How to login to Ms SQL Server 2008 from Windchill Shell?

Hi Guys,

1. I am trying to create a document subclass with a new integer attribute using Java annotation.

I was able to create a source file (.java) and compile the file.

Now I am trying to generate SQL scripts for my new document class. I executed the following command tools -Dgen.input=com.acme.*sql_script in Windchill Shell.

The expected result is to generate a SQL command necessary to create the database schema for my new subclass and I should see a generated schema in a location, but the SQL command is not generated in the desired location.

Kindly let me know If I am missing out any steps.

2. Also, I want to login to the MsSQL Server from Windchill Shell. Please let me know the command to login to SQL Server from Windchill Shell.

Thanks in advance.

Regards,

Rajeshkumar Balaganesan

2 REPLIES 2

Where did you stored your source java file? You should put it in %WNCHOME%/src/your_dir directory. And then try to generate the SQL script file, that should be stored in %WNCHOME%/db/sqlServer/your_dir.

To answer your second question, you can log into SQL Server from the Windchill shell (or any command prompt) by using SQL Server's built in sqlcmd utility. The syntax to log into SQL Server is:
sqlcmd -S <ServerName> -U <Username> -P <password> -d <databaseName>

To run a script, you can use:

sqlcmd -S <ServerName> -U <Username> -P <password> -d <databaseName> -i <sql script> -o <output file>

If you leave off the -o argument, the script will output its results to the shell.

Announcements


Top Tags