To get the current date and time in SQL Server current date, use the GETDATE() function. This function returns a datetime data type; in other words, it contains both the date and the time, e.g. 2019-08-20 10:22:34 . Or you can use, SYSDATETIME (return type datetime2), with the difference being the precision up to…
Salesforce
Answered Aug 23, 2021
·
1.8K Views
Read answer →
To find all occurrences of a substring in a string Python does not have any built-in string function that does what you're looking for, but you could use the more powerful regular expressions: import re string = "test test test test" [m.start() for m in re.finditer('test', 'test test test test')] Or Use re. finditer()…
Devops
Answered Jul 18, 2021
·
1.9K Views
Read answer →
If you want to access $scope parent property from within your child controller. You can follow the below-mentioned steps:- As you have defined cities in the parent controller your child controller will inherit all scope variables. But you do not have to call $parent. See the code below:- function ParentCtrl($scope) {…
Devops
Answered Jul 1, 2021
·
1.8K Views
Read answer →
It can be retrieved in two ways: Via GUI: 1. Connect to server 2. Connect to the database 3. Click on the database and expand--> Click on Programmability --> Click on stored Procedure --> you will get the list of procedures 4. Right click on procedure name à script stored procedure asà create to à click on New Query…
SQL Server
Answered Feb 25, 2020
·
1.6K Views
Read answer →
Below operations are not allowed in the function: 1. We can create / insert /update/delete/alter/ truncate to a permanent table in a function 2. We can’t execute any user define procedure in the function 3. We can apply for transactions inside a function 4. Exception handling is not possible inside a function 5. We…
SQL Server
Answered Feb 15, 2020
·
1.8K Views
Read answer →
For the out parameters we need to mention the Out explicitly with the parameters, below is the sample and details for the same: -- Create Stored Procedure CREATE PROCEDURE usp_TestOutParameter @p_First VARCHAR(50), @p_Second VARCHAR(50) out AS begin SELECT @p_Second =col2 from input_values where col1=@p_First
SQL Server
Answered Feb 5, 2020
·
1.8K Views
Read answer →
Yes we can execute different /same procedure inside a procedure and pass the parameters and get back the result from the procedure. For the recursive calling of procedure SQL only allow you for the 32 times so you can call it only in case you are confirmed that it will not be executed more than 32 times else you will…
SQL Server
Answered Feb 3, 2020
·
1.7K Views
Read answer →
SQL gives you an option to save the transaction at any point during the execution of the procedure. Whenever an exception occurs during the transaction it will be rolled back to the last save point/ transaction . We can have multiple save points in a single procedure/ transaction. Syntax to save transaction is as…
SQL Server
Answered Jan 29, 2020
·
1.6K Views
Read answer →
We need to create an exceptions Log table which will store all the exceptions raised by the procedure. This table will be a common table for all the procedure/jobs, which will capture data on every exception caused. Below is the format of table which can be used to capture the same CREATE TABLE Errors_Procedures…
SQL Server
Answered Jan 29, 2020
·
1.5K Views
Read answer →
The store procedures are stored on a temporary basis. There are 2 types of stored procedure: Private /Local Temporary Stored Procedure Public/ Global Temporary Stored Procedure Local temporary SPs: These kinds of procedures can be executed by the present session only and are dropped at the end of the session. This can…
SQL Server
Answered Jan 28, 2020
·
1.9K Views
Read answer →
In case there is an exception in the inner transaction then all the transactions which outer to that will get rollback. i.e. if we have transaction1 inside that we have transaction 2 and after that we have transaction 3, and then transaction 3 gets committed after that some statement in transaction 2 fails then…
SQL Server
Answered Jan 28, 2020
·
2.2K Views
Read answer →
The table decision is purely dependent on the use case of the table. I.e. when the table is required for short span to use within the procedure with small number of column and less 100 number of rows it is prescribed to use a table variable as the table variable is not included in the query plan and work very fast as…
SQL Server
Answered Jan 27, 2020
·
1.5K Views
Read answer →