Follow the below MS SQL syntax for create new CursorDECLARE emFIRST CURSOR FORSELECT EMP_NUMBER FROM HS_HR_EMPLOYEEOPEN emFIRSTWHILE (@@fetch_status <> -1) BEGINPRINT @EMP_NUMBERFETCH NEXT FROM emFIRST INTO @EMP_NUMBER END CLOSE emFIRSTDEALLOCATE emFIRST
My requirement is to use the SUBSTRING() dynamically in SQL query. I have the set of data in a table. I want to pick only the last 6 digits.General syntax of the SUBSTRING functionSUBSTRING ( expression ,start , length )I'm using below query according to my requirement.SELECT SUBSTRING(VALUE,LEN(VALUE)-6+1,LEN(VALUE)+1) FROM TEST
My requirement is to get the 1st date of the year. I'm using below command line to fulfill this task.SELECT CONVERT(VARCHAR,YEAR(GETDATE())-1)+'/01/01' When it become the last day of the year, I can change the query like this.SELECT CONVERT(VARCHAR,YEAR(GETDATE())-1)+'/12/01' Then I want the 1st February in this year. It can be taken by usingSELECT CONVERT(VARCHAR,YEAR(GETDATE())-1)+'/02/01' I believe this command will help ...
You can create table backups by using below commands.In MS SQLSELECT * INTO <backup_table_name> FROM <original_table_name>Ex:SELECT * INTO FUEL_DETAILS_BACK FROM FUEL_DETAILS In OracleCREATE TABLE <backup_table_name> AS SELECT * FROM <original_table_name>Ex:CREATE TABLE HR_LEAVE_ENTITLE2011 AS SELECT * FROM HR_LEAVE_ENTITLE
Open the command prompt and run below command to enable 32 bits applications hosted in IIS of Windows Server 2003 64 bit edition since the option is not available through the interface.cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
I'm using Microsoft Excel for formatted my data sheet. I want to merge few cells data to a one cell. The way of I do thisI want to remove some selected values in a cell. The way of I do this
My requirement is to order the contents of my selected SQL query. I can use ORDER BY for fulfill this task, but the problem is it will order my entire SQL query with ascending order or descending order according the way of using it. But my requirement is order the separate sub groups of my selected query. Let take this ...
My requirement is to rename the schema in selected tables/views.Let take a example like this.Existing table name - HRADMIN.VW_HR_EMPLOYEERequired table name - HRUSR. VW_HR_EMPLOYEEYou can simply do this by using below SQL command by login with sa account. Make sure your rename schema is exists under your Data Base. Otherwise you need to create it manually.ALTER SCHEMA <HRUSR> TRANSFER <HRADMIN>.< ...