Translate

Thursday, 20 April 2017

sql : get day,month and year in a date

I have run this query ie today(20 April 2017) is  2017-04-20 14:42:33.093

SELECT getdate()--2017-04-20 14:42:33.093
SELECT datepart(day, getdate())--20   -- Day
SELECT datepart(Month, getdate())--4 --- Month
SELECT datepart(YEAR, getdate())--2017--Year

Tuesday, 18 April 2017

MySQL create table syntax

CREATE TABLE `tableNmae` (
  `SlNo` int(11) NOT NULL AUTO_INCREMENT,
  `Name` text,
  `SysDate` datetime DEFAULT NULL,
  `Estatus` text,
  `details` text,
  PRIMARY KEY (`SlNo`)
);commit;

download file from SFTP using WinSCP with batch file(SSIS using process task )

For download
-------------------
option batch on
 option confirm off
 open sftp://UserName:Password@SFTPName:portnumber/ -hostkey="winscphostKey"
 get  SFTPFILEnamewithextension
 close
 exit


For remove file from SFTP
-------------------
option batch on
 option confirm off
 open sftp://UserName:Password@SFTPName:portnumber/ -hostkey="winscphostKey"
 rm  SFTPFILEnamewithextension
 close
 exit



For rename  file from SFTP
-------------------
option batch on
 option confirm off
 open sftp://UserName:Password@SFTPName:portnumber/ -hostkey="winscphostKey"
 mv  oldNamefromSFTPfile userNewname
 close
 exit

MySQL get database table create table in query format

 SHOW CREATE TABLE `Yourtablename`;COMMIT;
example :
I have a table in MySQL ie FredtoMySQL_execution_log and I want to see the definition ie below code

 SHOW CREATE TABLE `FredtoMySQL_execution_log`;COMMIT;

MySQL rename table

 RENAME TABLE ssis_execution_log TO SQLtoMYSQL_execution_log;COMMIT;

Thursday, 13 April 2017

what is .NET Framework ?

.NET Framework is set of tools, libraries, languages to build Desktop, Console , Web , Mobile ,IOS  applications and run time required to run those applications.

The full Form of .NET is Network Enabled Technologies.
 Or Distributed oriented Technologies






Wednesday, 22 March 2017

mysql get current process

SELECT* FROM INFORMATION_SCHEMA.PROCESSLIST;
#or
SHOW FULL PROCESSLIST;
#after that kill the id by this query;
KILL 6718;COMMIT;