With years of experience in C# development and SQL database management, I'm here to share insights, tips, and best practices to help you level up your skills.
📚 What You'll Find Here:
🔹 C# Mastery:
🔹 SQL Essentials
🔹 Best Practices
🔹 Real-World Projects
How to generate random numbers in sql server
Get link
Facebook
X
Pinterest
Email
Other Apps
SELECT RandomNumber = CONVERT(VARCHAR,ABS(CHECKSUM(NEWID())))
FROM master.dbo.spt_values
ORDER BY RandomNumber
---- Quarterly SELECT CASE WHEN MONTH(date_column) IN (1, 2, 3) THEN 'Q1' WHEN MONTH(date_column) IN (4, 5, 6) THEN 'Q2' WHEN MONTH(date_column) IN (7, 8, 9) THEN 'Q3' WHEN MONTH(date_column) IN (10, 11, 12) THEN 'Q4' END AS quarter, CONCAT(YEAR(date_column), CASE WHEN MONTH(date_column) IN (1, 2, 3, 4, 5, 6) THEN '-H1' WHEN MONTH(date_column) IN (7, 8, 9, 10, 11, 12) THEN '-H2' END) AS half_year, COUNT(*) AS count FROM your_table GROUP BY quarter, half_year ORDER BY quarter, half_year; --- Half Yearly SELECT YEAR(d...
Upload File from Local Machine to SFTP Server in C# The following C# code will upload a file from local machine to SFTP server. string _ftpURL = "testsftp.com"; //Host URL or address of the SFTP server string _UserName = "admin"; //User Name of the SFTP server string _Password = "admin123"; //Password of the SFTP server int _Port = 22; //Port No of the SFTP server (if any) string _ftpDirectory = "Receipts"; //The directory in SFTP server where the files will be uploaded string LocalDirectory = "D:\\FilePuller"; //Local directory from where the files will be uploaded string FileName = "test.txt"; //File name, which one will be uploaded Sftp oSftp = new Sftp(_ftpURL, _UserName, _Password); oSftp.Connect(_Port); oSftp.Put(LocalDirectory + "/" + FileName, _ftpDirectory + "/" + FileName); oSftp.Close(); tamir.sharpssh.dll can be downloaded from below link. https://sourcef...
Comments
Post a Comment