How to use print in data grip - sybase

How can I use the function print from sybase ase 16 in a script in datagrip? It is working fine when using aqua data studio but datagrip is showing an error for each print in the script.

Related

How do you debug or step through the code in SQL Server Management Studio 18?

SQL Server Management Studio used to have Debug functionality that would allow to step through the code and watch the values etc. Referring to How to add the Debug button to SSMS v18?, I understand that the functionality is removed from SQL Server Management Studio V18.1.
But what is the alternative now? How do you step through the code to pinpoint a bug in the code?
You can use Visual Studio (the full IDE) to do it:
Use "Server Explorer" (Under the View menu) to connect to your DB
Right-click the DB and choose "New Query" (or find a stored procedure to debug)
Set a break point (F9 key or otherwise) on a line of SQL
Right-click inside the SQL editor and choose "Execute with Debugger"
Your best option is to not upgrade version 18.X, but stay on 17.9 until the Microsoft Product Manager gets sacked. A similar thing happened in going from SQL Server 2000 to SQL Server 2k5. Eventually, they capitulated and re-introduced the feature.
Ta for answer above, but when trying to debug with Sever Explorer, I find that "SQL Debugging is not supported on Microsoft Azure SQL Database'... ho hum, so I downgrade to SSMS 17.9 or dump the database to local and do it there.
Nice, I just wanted to quickly debug something... by the time I've done that lot I'll have forgotten what the problem I was trying to fix was !
It's deprecated, so you don't. Personally, I never use the feature and I'm assuming many others didn't either (which is why it's being retired).
The work around is to debug stored procedures by outputting values using PRINT or RAISERROR. Using BEGIN TRAN / ROLLBACK this works well because you can easily run code against the same data.
It's not the same as step through debugging, but it works.

Getting insufficient memory error while running 270 MB script on SQL Server 2012

I am using SQL Server 2012, I have a script to update the DB, that script is approx 270 MB in size and contains some about 22,00,000 lines.
Error :
Error message : System.OutOfMemoryException
Also,
I tried Transact-SQL command Query method but at particular line its giving error message.
Sqlcmd: Error: Syntax error at line 709918 in file 'database.sql'.
But there is not syntax error.
Please provide any solution on this.
That's already quite big for SQL Management Studio, especially if the script contains long lines and anything too complex.
Your best options are probably:
Use sqlcmd instead of SQL Management Studio
Break the script down into multiple files you can execute one after another
Don't forget that even just for the file, you need at least 550 MiB of memory, since Management Studio is a .NET application and uses Unicode. And then there's the GUI, and the syntax analysis, and parsing... And since the script isn't streamed by SMSS, unlike SqlCmd, you will likely have the whole file in memory at least twice, and you're already getting close to the limit of the 32-bit application, especially on an 32-bit OS...
No Need to do any manual splitting or any command line execution.
Just download this software - Big SQL Script File Runner
It will save your full day.

Microsoft Sql Server management studio not recognizing unicode Kannada Font

I have Microsoft Sql server management studio 2014 and i need to store statments in Kannada in it.
I have unicode kannada font BRH Kannada installed in my laptop , and visual studio is successfully displaying kannada.
I created my table and give my column nvarchar as the data type.
When i am inserting data, the kannada statements are being displayed as they are but when i retrieve using Select statement, it's showing ?? for each character.
I set the font of grid result as Arial Unicode MS also, still it's showing ??.
I understood my mistake..
https://aalamrangi.wordpress.com/2012/05/13/storing-and-retrieving-non-english-unicode-characters-hindi-czech-arabic-etc-in-sql-server/
Data is supposed to be inserted with an N before it..N''

Error on compile or run the application on VS2010 & SQL Server 2012 Express

I'm getting an error when I try to compile or run the application.
Performing a simple tutorial, I worked at first but now when I generate the project F6 or try to run it, I always get the error
Error 1 Unable to copy
"C:\Projects\DatabaseExampleApp\DatabaseExampleApp\App_Data\northwnd.mdf"
to "bin\Debug\App_Data\northwnd.mdf". The process can not access the
file 'bin\Debug\App_Data\northwnd.mdf' because it is being used by
another process. DatabaseExampleApp
The first time when I run the app worked fine
I'm using:
Visual Studio 2010 Professional
SQL Server 2012 Express 64-bits
EDIT:
after:
kill the sqlservr.exe (is the file locker)
delete the files myself northwnd.* northwnd_log.*
generate project F6
run the app work fine
But I have a questions:
how kill or unload the file northwnd.mdf to avoid this problem?
The app compile after that but don't run
You're not showing us your connection string, but I'm assuming you're using some kind of AttachDbFileName=.... approach.
My recommendation for this would be: just don't do that. It's messy to fiddle around with .mdf files, specifying them directly by location, you're running into problems when Visual Studio wants to copy that file around - just forget about all that.
I would
create the database on the SQL Server Express instance (CREATE DATABASE ..... in Mgmt Studio)
talk to the database by its logical name - not a physical file name
So I would put my database onto the SQL Server Express server instance, and then use a connection string something like this:
Server=.\SQLEXPRESS;Database=MyShinyDatabase;Integrated Security=SSPI;
No messy file names, Visual Studio won't have to copy around files at runtime or anything, your data is on the server and can be used and administered there - seems like the much cleaner and much nicer approach to me.

How do I fix "incorrect syntax near GO" errors in scripts generated with Microsoft's Database Publishing Wizard?

I've been searching for a "definitive" solution to this for a couple of hours now and can't find out exactly what the problem is so am hoping someone can point me in the right direction.
I'm trying to create a script for a database (an MDF file DB) on a remote machine and use it to create the same database locally. I've got Visual Studio 2010 on both machines so used the Database Publishing Wizard to generate the script.
I next created a blank DB in Visual Studio locally (another MDF file DB) and selected to create a new query. I've pasted the copied script in but when I try and run it I get dozens of "incorrect syntax near GO" errors. I'm not sure how many in total as the alert pop-up goes off the bottom of my screen. It would seem to be a lot though.
I trimmed off all but the very top of the script and I still get the same errors with it. It now looks like this:
SET ANSI_NULLS ON
GO
I still get the "incorrect syntax near GO" error with this.
Is there something inherently wrong with the scripts this tool generates or am I doing something wrong with it?
The remote DB is 2008 R2 and my local is just plain 2008, hence why I don't just copy the MDF file across.
If anyone has any suggestions, they would be most welcome.
From the docs:
GO is not a Transact-SQL statement; it
is a command recognized by the sqlcmd
and osql utilities and SQL Server
Management Studio Code editor.
Either use such a tool to execute the script or omit the GO commands.
I ran into the same problem recently and found the right answer to it (I think).
If you create a query in some random editor other than SQL Server Management Studio Code editor at the end of a line you may get a CARRIAGE RETURN (\r) character instead of a CARRIAGE RETURN + LINE FEED (\r\n). And even if you hit the DEL key at the end of the line and then Enter it doesn't change.
Use Notepad++ to replace CR (\r) for CRLF (\r\n) - keep the order, it's important!

Resources