Is there a way to see the SQL executed by Rapid SQL for stored procs? - rapidsql

Using the Embarcadero Rapid SQL client tool, you may list Procedures from a database, right-click one a choose "Execute" which opens up a dialog where you can enter the input parameter values, then click the Execute button to run the procedure and see the results grid.
But I dont see anywhere that shows me what SQL the tool ended up running- is there a way to enable this output so that I may view it, copy it, share it with colleagues or run the SQL directly if I need to?

If you are working on SQL Server you may run SQL Server Profiler (under Tools/ SQL Server Profiler) and trace the querys that you are run it in the database engine. In the column of application name you will see "Rapid" or something like that. This is very useful to track all T-SQL (included store procedures by the way) statements executed in the engine.

Related

Cannot view object schema Azure Datawarehouse

Attempting to view the a view or procedure:
from SQL Server Management Studio 17.4 in Azure SQL Datawarehouse notes the error:
I can however, delete and create any object that I want.
How can I work to ensure I can view the objects definition?
UPDATED
Concerning setting the options in SSMS to SQL Datawarehouse, there is not that option:
Please change this setting under Tools... Options. That should resolve the error. I wish we didn't have to change this but at lease we have a workaround.
In SSMS 17.5 there are a few more options. You can have it automatically detect what type of database you're connected to and script accordingly. Or you can force it to script for a particular database type like the following screenshot.
It appears there is a bug in certain versions of SSMS (such as 17.5) where if the DW user isn't also a user in the master database then scripting fails. The easy fix for this is having the server admin connect to the master database and run:
CREATE USER MyUserNameHere FROM LOGIN MyUserNameHere;
Sorry you're seeing this. I've been able to repro this on SSMS 17.4 and 17.5. We are looking at this now.
This seems to be a defect in the upgrade path for 17.5 as this should be supported without having to change the script settings. We are investigating this and will try to get an update out as soon as possible.

How do you tell entity framework to create / deploy a database in Azure?

I'm using Entity Framework with a code first model; I've got my InitialCreate migration setup and working locally, I can run code against my database context, and everything works.
But when I deploy my project to Azure, I just get a connection string error ("Format of the initialization string does not conform to specification starting at index 0.").
I can't seem to find where in the Publish dialog are the options to create the Azure database. -- Do I have to create the database separately and hook them up manually? -- If so, what exact process should I follow. Does the database need to have contents?
I thought Microsoft was making a big deal that this could all be done in a single deploy step, but that doesn't seem to be the case from my current experience.
When you publish your project in the publish dialog, there is an option for the code first migration in the Settings tab, it will automatically show your data context and it will give you the option to set the remote connection string, and this will add a section in web.config to specify the data context and the Migration class to run during the migration process.
It will also allow you to set if you want to run the code first Migration or not.
You can also take a backup from the dev and clear the data then upload it to Azure SQL DB, this way the code first data context will check at first connection and it will find the code an database the same

Login failed for user 'DOMAIN\user'

I'm trying to use a localDB as a local development database, but not matter what I do, I always get the exception Login failed for user 'DOMAIN\user'.
Example: right-click on data connections in the server explorer pane in vs2012. Select add connection, select Microsoft SQL Server Database File under data source and click continue. Browse to the location you want to save the database file, use windows authentication, click okay, see error.
I've tried removing all sql components from my machine and installing a fresh instance of SQL Server Express LocalDB several times to no avail.
How do I figure out which data user the database is expecting? How can I install it so that my current user can use it?
Any Help will be much appreciated.

Creating SQL Agent JOBs in SQL Server 2012 Database Projects from VS 2012

I am working on Visual Studio 2012 with Update 2 + SQL Server Data Tools and I am able work on the SQL Server Database Projects.
How do I create/add new SQL Agent JOB into this database project? Because if I click Add - New Item... I don't see anything for Job.
I know Jobs are related to SQL Server and the Database Project is related to a SQL Database. But I was wondering how do manage the SQL Jobs?
Thanks,
Prabhat
Jobs aren't supported natively. It might be possible to add these from the post-deployment script, although it's not something I've tried.
Creating server agent objects are not supported by visual studio database projects; however you can add your job by calling dbo.sp_add_job stored procedure.
The easiest way will be:
Create your job by SSMS and copy the script.
Control the job is already exist at database or not at your post deployment script. if it is exist delete at first; or you are going to have an error during deployment. you can do something like below:
DECLARE #JobID BINARY(16)
SELECT #JobID = job_id
FROM msdb.dbo.sysjob
WHERE (name = N'NameOfYourJob')
IF (#JobIDdel IS NOT NULL)
BEGIN
EXECUTE msdb.dbo.sp_delete_job #job_name = N'NameOfYourJob'
END
Paste your script for creating job to post deployment script.
For feeling more safe you can check the job is working at the moment or not and
you can disable job also before deleting.
Disable a job
Check job status

InstallShield 2012: Need to switch between sql scripts (sql server & oracle) based on property

The web applications I am installing can run against either a SQL Server or Oracle database. I need to be able to determine which database the user has (client is suggesting a property file) and then dynamically tell InstallShield whichSQL script to run, I know I can figure out how to determine which database is installed. My question is how do I configure the Feature/Component and tell InstallShield which script to use.
I don't have any Oracle servers available to me nor do I have the Oracle Instant Client. If I did, it seems I'd use a Basic MSI project included in InstallShield to build an Oracle Instant Client MSI and add it to my installer as a setup prerequisite. Kind of odd but I guess they couldn't get IBM / Oracle to play nicely.
So let's say I had all of that. I'd create a Sql connection that supported both MS and ORA SQL and build it. I'd run the installer with logging on and use the SQLLogin dialog to browse to a SQL instance and an Oracle Instance.
Then I'd look at that logfile and see if there's any evidence of the built-in InstallShield SQL custom actions setting a property that indicates the type and/or version of database server that it connected to. Hopefully something will surface because I didn't find anything in the documentation.
Once I figured that out, I'd use the property in a conditional expression so that the SQL scripts only ran on the type of database server they were intended.

Resources