I work with Sybase Central 4.3.0.2428 and the server is Sybase ASE 16.0 SP01 PL03/EBF 24830.
I would like to debug stored procedures.
How do I do that?
There is a command line tool called sqldbgr. Look for the manual to check the parameters and commands.
Years ago Sybase has released a Eclipse based suite called Sybase Workspace. It had included an interface for the SQL debugger. But the product is no longer maintained and is no longer available. You will have trouble to find the binaries.
Related
I am searching for command line tools to execute the script files in Sybase. If anyone could point me to a download links will help.
'Sybase' is actually not a database, since there are 3 different database from the Sybase brand: Sybase ASE, Sybase IQ and Sybase SQL Anywhere (Incidentally, Sybase has been renamed to SAP since quite a few years.)
For ASE, the standard tool for batch execution is 'isql -i'. For IQ or SQL Anywhere, you can use 'dbisql -nogui'. See the respective documentation for details.
I have a multi-database setup that I need to work with and both have their own bcp versions that do not act the same way. Plus both are in my %PATH% and the Sybase one is listed before the MS SQL exe so calling "bcp" from the command line always hits the Sybase exe.
First, the versions are "different":
Sybase BCP:
Sybase CTBCP Utility/15.0/P-EBF17890 ESD #24/PC Intel/BUILD1500-123/OPT/Thu May 13 02:45:43 2010
(for Adaptive Server Enterprise/15.7/EBF 23008 SMP SP130 /P/RS6000/AIX 6.1/ase157sp13x/3819/64-bit/FBO/Sat Aug 23 02:49:06 2014)
MS SQL BCP:
Version: 11.0.2100.60
(queries hitting SQL 2008 R2 and 2012 SP3 dbs)
They definitely do not handle output to a file the same way and the docs for each show that. Everything I read on bcp says that bcp should work the same between Sybase and MS SQL but I have to call the full MS SQL bcp.exe path for a queryout call to MS SQL because the Sybase bcp does not support the queryout the same way.
My process uses a batch script to call multiple queries that hit the Sybase DBS and then MS SQL databases to output data to a staging db, will I always have to differentiate between the Sybase and MS SQL bcp's or can I use just one without issue? If so, which one is the "right" one to use (not trying to spark a debate here on which is better). Also, I see nothing showing that the version numbers have any relation what so ever so knowing which is the "latest" and using that one is proving difficult.
Keep in mind that MS SQL Server was identical to Sybase ASE back in 1994 (the called Sybase SQL Server), but after that, they slowly started to move apart. So the concept of BCP is still there and similar, but the details are different.
For one thing, do not expect to be able to interchange client tools for these databases: Microsoft has made changes to the TDS protocol that makes it impossible to connect a client to the other vendor's databases.
If you've got a clash between to two executables with the same name, common solutions include (i) explicitly specifying the executable's pathname (ii) setting the right environment variables before calling one or the other executable (iii) renaming one of the executables. YMMV.
I have a PB application connecting to Sybase ASE; Is there a way we can trace the DB calls when the application is running.
I used to do that in Oracle 10/11G but unable to figure out in sybase ase.
It will be immensely helpful if I am able to run a module in PB application and check the queries executed after that.
I am using either DBVisualizer or RapidSQL.
Use the MDA tables. For example, monSysStatement and monSysSQLText. See the ASE documentation and/or www.sypron.nl/mda.
I got a new task as follows:
Export stored procedures on a daily basis from db
Run them through sonarqube to analyze
I am not a db expert but working in DevOps team. Can anyone tell me if SonarQube supports the analysis of T-SQL stored procedures? If not, which tool does? I see only PL/SQL here in the supported language list: http://docs.sonarqube.org/display/PLUG/Plugin+Library
This one looks promising
https://github.com/gretard/sonar-tsql-plugin
(still in beta version as of now)
All plugins supported by SonarQube team & community are listed in documentation: http://docs.sonarqube.org/display/PLUG/Plugin+Library
You should search for plugins by other companies. I found only TechCognia's TSQL Plugin.
How do you manage revisions of stored procedures?
We have a BI solution on SQL Server 2005 with hundreds of stored procedures.
What would be a good way to get these into Subversion? What are your recommended tools to script stored procedures to files?
There are doubtless a bunch of off-the-shelf products you could buy (I think a few RedGate tools might come in handy here), as well as Visual Studio Team Suite - Database Edition.
In light of purchasing something, why not consider using SQL Management Objects (SMO)?
I've written a couple of utilities which generate T-SQL scripts (using the Scripter class) which produces the same scripts you get from generating scripts through the SQL Server Management Studio (it uses the same functionality).
You could integrate such a utility into a build script/build process which would allow you to generate scripts and then version & check them into a source repository. Plus, you can batch the scripts into a single file (if desired) which beats maintaining hundreds of individual files.
I wrote a blog entry about this approach a while back.
Check out more on the SMO class Scripter
Here's a few more entries which might be useful:
http://www.sqlteam.com/article/scripting-database-objects-using-smo-updated
http://sqlblog.com/blogs/ben_miller/archive/2007/10/03/table-scripting-with-smo-part-1.aspx
See here and here for a start.
Please check out here What is the best way to version control my SQL server stored procedures?. Might help you identify couple of solutions to this issue.
I have previously used a Visual Studio Database Project to manage create table scripts, stored procedure scripts etc. I'm fairly sure you could then use subversion to manage these files in the same way as any Visual Studio project.
I used the built in functionality for scripting the procs, but i'm sure Redgate would have some tasty tools for that.