#getdate
Explore tagged Tumblr posts
Text
Measuring SQL Query Duration: GETDATE() and DATEDIFF()
Introduction Hey there, fellow SQL enthusiast! Have you ever wondered if using GETDATE() and DATEDIFF() is sufficient for measuring the duration of your SQL queries? Well, you’re in the right place! In this article, we’ll dive into the world of query performance measurement and explore the effectiveness of these functions. Get ready to level up your SQL skills and optimize your queries like a…
View On WordPress
0 notes
Text
Advanced Error Handling Techniques in Azure Data Factory
Azure Data Factory (ADF) is a powerful data integration tool, but handling errors efficiently is crucial for building robust data pipelines. This blog explores advanced error-handling techniques in ADF to ensure resilience, maintainability, and better troubleshooting.
1. Understanding Error Types in ADF
Before diving into advanced techniques, it’s essential to understand common error types in ADF:
Transient Errors — Temporary issues such as network timeouts or throttling.
Data Errors — Issues with source data integrity, format mismatches, or missing values.
Configuration Errors — Incorrect linked service credentials, dataset configurations, or pipeline settings.
System Failures — Service outages or failures in underlying compute resources.
2. Implementing Retry Policies for Transient Failures
ADF provides built-in retry mechanisms to handle transient errors. When configuring activities:
Enable Retries — Set the retry count and interval in activity settings.
Use Exponential Backoff — Adjust retry intervals dynamically to reduce repeated failures.
Leverage Polybase for SQL — If integrating with Azure Synapse, ensure the retry logic aligns with PolyBase behavior.
Example JSON snippet for retry settings in ADF:jsonCopyEdit"policy": { "concurrency": 1, "retry": { "count": 3, "intervalInSeconds": 30 } }
3. Using Error Handling Paths in Data Flows
Data Flows in ADF allow “Error Row Handling” settings per transformation. Options include:
Continue on Error — Skips problematic records and processes valid ones.
Redirect to Error Output — Routes bad data to a separate table or storage for investigation.
Fail on Error — Stops the execution on encountering issues.
Example: Redirecting bad records in a Derived Column transformation.
In Data Flow, select the Derived Column transformation.
Choose “Error Handling” → Redirect errors to an alternate sink.
Store bad records in a storage account for debugging.
4. Implementing Try-Catch Patterns in Pipelines
ADF doesn’t have a traditional try-catch block, but we can emulate it using:
Failure Paths — Use activity dependencies to handle failures.
Set Variables & Logging — Capture error messages dynamically.
Alerting Mechanisms — Integrate with Azure Monitor or Logic Apps for notifications.
Example: Using Failure Paths
Add a Web Activity after a Copy Activity.
Configure Web Activity to log errors in an Azure Function or Logic App.
Set the dependency condition to “Failure” for error handling.
5. Using Stored Procedures for Custom Error Handling
For SQL-based workflows, handling errors within stored procedures enhances control.
Example:sqlBEGIN TRY INSERT INTO target_table (col1, col2) SELECT col1, col2 FROM source_table; END TRY BEGIN CATCH INSERT INTO error_log (error_message, error_time) VALUES (ERROR_MESSAGE(), GETDATE()); END CATCH
Use RETURN codes to signal success/failure.
Log errors to an audit table for investigation.
6. Logging and Monitoring Errors with Azure Monitor
To track failures effectively, integrate ADF with Azure Monitor and Log Analytics.
Enable diagnostic logging in ADF.
Capture execution logs, activity failures, and error codes.
Set up alerts for critical failures.
Example: Query failed activities in Log AnalyticskustoADFActivityRun | where Status == "Failed" | project PipelineName, ActivityName, ErrorMessage, Start, End
7. Handling API & External System Failures
When integrating with REST APIs, handle external failures by:
Checking HTTP Status Codes — Use Web Activity to validate responses.
Implementing Circuit Breakers — Stop repeated API calls on consecutive failures.
Using Durable Functions — Store state for retrying failed requests asynchronously.
Example: Configure Web Activity to log failuresjson"dependsOn": [ { "activity": "API_Call", "dependencyConditions": ["Failed"] } ]
8. Leveraging Custom Logging with Azure Functions
For advanced logging and alerting:
Use an Azure Function to log errors to an external system (SQL DB, Blob Storage, Application Insights).
Pass activity parameters (pipeline name, error message) to the function.
Trigger alerts based on severity.
Conclusion
Advanced error handling in ADF involves: ✅ Retries and Exponential Backoff for transient issues. ✅ Error Redirects in Data Flows to capture bad records. ✅ Try-Catch Patterns using failure paths. ✅ Stored Procedures for custom SQL error handling. ✅ Integration with Azure Monitor for centralized logging. ✅ API and External Failure Handling for robust external connections.
By implementing these techniques, you can enhance the reliability and maintainability of your ADF pipelines. 🚀
WEBSITE: https://www.ficusoft.in/azure-data-factory-training-in-chennai/
0 notes
Text
Check the uptime of SQL Server instance
To check the uptime of a SQL Server instance, you can use the following query: SELECT sqlserver_start_time AS server_start_time, GETDATE() AS current_time, DATEDIFF(SECOND, sqlserver_start_time, GETDATE()) AS uptime_in_seconds, FORMAT(DATEDIFF(SECOND, sqlserver_start_time, GETDATE()) / 86400.0, 'N2') AS uptime_in_days FROM ( SELECT sqlserver_start_time = sqlserver_start_time() ) AS…
0 notes
Text
Everything You Need to Know About JavaScript Date Add Day

When Working With Dates in JavaScript, adding days to a date is a common yet essential task. JavaScript provides a straightforward way to achieve this by manipulating the Date object using methods like setDate and getDate.
By creating a function to add days, you can easily calculate future or past dates. For more complex date operations or handling various edge cases, consider using date libraries like Moment.js or date-fns.
For a comprehensive guide and additional resources on JavaScript date manipulation, including adding days, TpointTech offers valuable tutorials and examples to help you master this crucial aspect of programming.
Understanding JavaScript Date Objects
In JavaScript, the Date object is used to work with dates and times. You can create a Date object using the Date constructor, which can take different formats such as a string, a number representing milliseconds since January 1, 1970, or individual date and time components.
let today = new Date();
console.log(today); // Outputs the current date and time
To add days to a date, you'll need to manipulate this Date object.
Adding Days to a Date
JavaScript doesn’t have a built-in method to directly add days to a date, but you can achieve this by using the following approach:
Get the Current Date: Start by obtaining the current date using the Date object.
Add Days: To add days, you can manipulate the date by modifying the day of the month.
Here’s a step-by-step method to add days to a Date object:
function addDays(date, days) {
let result = new Date(date); // Create a copy of the date
result.setDate(result.getDate() + days); // Add the specified number of days
return result;
}
let today = new Date();
let futureDate = addDays(today, 5);
console.log(futureDate); // Outputs the date 5 days from today
In this code, the addDays function takes two parameters: the original date and the number of days to add. It creates a new Date object based on the original date and modifies it by adding the specified number of days using the setDate method. The getDate method retrieves the current day of the month, and by adding days to it, the date is updated.
Handling Edge Cases
When adding days, be mindful of edge cases, such as month and year boundaries. The Date object automatically handles transitions between months and years. For example, adding days to a date at the end of one month will correctly roll over to the next month.
let date = new Date('2024-08-30');
let newDate = addDays(date, 5);
console.log(newDate); // Outputs 2024-09-04
In this example, adding 5 days to August 30 results in September 4, demonstrating how JavaScript correctly manages month transitions.
Working with Time Zones
JavaScript dates are sensitive to time zones. The Date object represents dates in the local time zone of the system where the script is running. To avoid issues with time zones, especially when working with applications across different regions, you may need to convert between time zones or use libraries designed for handling time zones.
Using Libraries for Advanced Date Operations
For more complex date manipulations, including adding days, consider using a date library like Moment.js or date-fns. These libraries provide additional functionality and simplify date arithmetic:
Using Moment.js:
let moment = require('moment');
let today = moment();
let futureDate = today.add(5, 'days');
console.log(futureDate.format('YYYY-MM-DD'));
Using date-fns:
let { addDays } = require('date-fns');
let today = new Date();
let futureDate = addDays(today, 5);
console.log(futureDate.toISOString().split('T')[0]);
These libraries offer a more intuitive API for date manipulation and can be particularly useful in large projects.
Conclusion
Mastering the art of Adding Days to a Date in JavaScript is essential for effective data management in your applications. By using the Date object and its methods, you can easily manipulate dates to meet your needs, whether you're scheduling events or calculating deadlines.
For more complex date operations, leveraging libraries like Moment.js or date-fns can provide added convenience and functionality.
To further enhance your JavaScript skills and explore advanced date handling techniques, TpointTech offers comprehensive tutorials and resources. Embracing these tools and practices will ensure your date manipulations are accurate and efficient.
0 notes
Text
Working with Dates in JavaScript
This topic explores the Date object in JavaScript, a powerful tool for creating, manipulating, and formatting dates and times. The Date object allows you to handle a wide range of date and time operations, from getting the current date to parsing, formatting, and calculating dates. This topic covers the creation of Date objects, common methods and properties such as getDate(), setDate(), toLocaleDateString(), and getTime(). Practical examples demonstrate how to perform tasks like date arithmetic, formatting dates for display, and working with time zones. Mastering the Date object enables you to handle date and time functionality effectively in your JavaScript applications.
0 notes
Text
random data create code:
DECLARE @I AS INT=0 WHILE @I<10000 BEGIN DECLARE @NAME AS VARCHAR(15) DECLARE @GENDER AS VARCHAR(1) DECLARE @SURNAME AS VARCHAR(20) DECLARE @CITY AS VARCHAR(30) DECLARE @TOWN AS VARCHAR(30) DECLARE @BIRTHDATE AS DATETIME
DECLARE @RAND AS INT SET @RAND= RAND()*609
SELECT @NAME=NAME,@GENDER=GENDER FROM NAMES WHERE id=@RAND
SET @RAND= RAND()*16000 SELECT @SURNAME=SURNAME FROM SURNAMES WHERE id=@RAND
SET @RAND= RAND()*900 SELECT @CITY=CITY,@TOWN=TOWN FROM CITY_DISTRICT WHERE id=@RAND
SET @RAND=RAND()36580 SET @BIRTHDATE=GETDATE()-@RAND
INSERT INTO CUSTOMERS ( NAME, SURNAME, BIRTHDATE, CITY, TOWN,GENDER) VALUES ( @NAME, @SURNAME, @BIRTHDATE, @CITY, @TOWN,@GENDER)
SET @I=@I+1 END SELECT * FROM CUSTOMERS
0 notes
Photo

#NMN1 #NMNisReal #LadiesOfTheNMN #MenOfTheNMN #FollowTheNoise #ColorOfLove #MyBrother @djfrisco_03 AND #MySisIndi @indi190 WE TOOK #ClubFrisco TO #DeepCreek AND WE DAMN SURE CUT UP FOR THE #1stAnnualDJsHunnieVaca MAN IT WAS 🔥🔥🔥🔥🔥🥃🥃🥃🥃🥃 #GetDat 💪🏾💪🏾💪🏾 https://www.instagram.com/p/CI2AoixhknA/?igshid=5g4cirej2rwg
#nmn1#nmnisreal#ladiesofthenmn#menofthenmn#followthenoise#coloroflove#mybrother#mysisindi#clubfrisco#deepcreek#1stannualdjshunnievaca#getdat
0 notes
Photo

In the Pink ready for my interview with Phil and Holly @thismorning! Cougar Gran rides again ❤ #thismorning #lockdownlust #firstdates #getdating #fashion #style #lockdownlove https://www.instagram.com/p/CCJgPecFvvk/?igshid=svzb42gs8ex0
0 notes
Link
https://www.youtube.com/watch?v=B--3CChJMBQ
0 notes
Text
Pisca-pisca é um ótimo recurso decorativo de Natal
Pisca-pisca é um ótimo recurso decorativo de Natal
Especialista complementa que o acessório pode ser inserido ainda em vasos e garrafas, decorar quartos e escritórios O pisca-pisca é um grande curinga na decoração de Natal. Uma árvore sem esse recurso pode ficar sem graça, sem vida. De acordo com o arquiteto Fabiano Ravaglia, ele pode, inclus
Notícias Do Dia
Leia a postagem completa: http://www.noticiasdodia.info/2017/12/pisca-pisca-e-um-otimo-recurso-decorativo-de-natal/
0 notes
Text
[JAVASCRIPT]요일별 날짜분류
#설명
시작일, 종료일을 입력하면 시작~종료일 사이에 있는 모든 날짜들을 요일별로 분류하는 스크립트 이다.
#TAG
javascript, jquery, html
#HTML
<h3>#요일별 날짜 분류</h3> <lavel>시작일</lavel><input type="text" id="sDate"><lavel>종료일</lavel><input type="text" id="eDate"><button id="execute">날짜구하기</button> <br><br><lavel>월요일 :</lavel><div id="mon"></div> <lavel>화요일 :</lavel><div id="tue"></div> <lavel>수요일 :</lavel><div id="wed"></div> <lavel>목요일 :</lavel><div id="thu"></div> <lavel>금요일 :</lavel><div id="fri"></div> <lavel>토요일 :</lavel><div id="sat"></div> <lavel>일요일 :</lavel><div id="sun"></div>
#JAVASCRIPT, JQUERY
var weeks = ["sun","mon","tue","wed","thu","fri","sat"]; var kWeeks = ["일","월","화","수","목","금","토"]; var lang = "en"; $("#execute").on("click",function(){ var sDate = $("#sDate").val(); var eDate = $("#eDate").val(); if(sDate != "" && eDate != ""){ if(lang == "ko") { kWeeks.forEach(function(wk) { var results = getWeeks(sDate,eDate,wk,lang); $("#"+wk).text(results.toString()); }); }else if(lang == "en"){ weeks.forEach(function(wk) { var results = getWeeks(sDate,eDate,wk,lang); $("#"+wk).text(results.toString()); }); } } }); // 시작일 ~ 종료일 에서 특정요일의 일자를 배열로 리턴 function getWeeks(sDate,eDate,week,lang){ var resultWeeks = new Array(); var dates = getDates(sDate,eDate); dates.forEach(function(date) { var strDate = parseDateToStr(date); var conditionWeek = getWeekday(strDate,lang); if(conditionWeek == week){ resultWeeks.push(strDate); } }); return resultWeeks; } // 해당일의 요일 구하기 function getWeekday(mdate,lang){ var yy = parseInt(mdate.substr(0,4), 10); var mm = parseInt(mdate.substr(4,2), 10); var dd = parseInt(mdate.substr(6,2), 10); var d = new Date(yy,mm -1, dd); if(lang == "ko"){ return kWeeks[d.getDay()]; } else if(lang == "en"){ return weeks[d.getDay()]; } else { return weeks[d.getDay()]; } } // 두날짜사이의 날짜 배열로 리턴 function getDates(sDate, eDate) { var startDate = parseStrToDate(sDate); var endDate = parseStrToDate(eDate); var dates = [], currentDate = startDate, addDays = function(days) { var date = new Date(this.valueOf()); date.setDate(date.getDate() + days); return date; }; while (currentDate = width ? n : new Array(width - n.length + 1).join('0') + n; }
#실행결과
#jsfiddle
https://jsfiddle.net/Kimby91/v0je427c/8/
1 note
·
View note
Text
3 notes
·
View notes
Text
this ^ answers fucking everything
so first things first. I was like, why the fuck is getMonth() not returning the correct month? It’s May. WHY IS IT RETURNING APRIL??
And then I realized it’s because whoever wrote the API decided to start indexing months at ZERO.
WHY. ZERO IS NOT A MONTH.
but then I *still* wasn’t getting the right day/month when I called getMonth() and getDate() on my UTC date “new Date('2000-01-01T00:00:00.000Z’)”, and I suspected it was probably a timezone thing because fuck timezones.
45 minutes of my life later and I realize. fucking. there’s a getUTCDate() and getUTCMonth() function specifically for UTC dates. vs getMonth() and getDate() which are local.
And okay I guess if I’d read the documentation more carefully I’d probably have figured this out sooner but seriously????
fuck dates man.
(and you should have a link to getUTCDate() and getUTCMonth() on your getDate() and getMonth() pages like! how else are people supposed to realize getUTCDate() and getUTCMonth() exist????!)
#i wanted to leave at 4:30 today lmfao#but then i got stuck on this date thing and i was like f u c k y o u i'm not leaving my fucking desk until i fucking figure this out#this has been a saga
1 note
·
View note
Text
Layouteditor datatype

#Layouteditor datatype code#
#Layouteditor datatype download#
In order to evaluate the expression + ' is not a string.', SQL Server follows the rules of data type precedence to complete the implicit conversion before the result of the expression can be calculated. Msg 245, Level 16, State 1, Line 3 Conversion failed when converting the varchar value ' is not a string.' to data type int. In this case, the SELECT statement throws the following error: The following example, shows a similar script with an int variable instead: DECLARE INT The int value of 1 is converted to a varchar, so the SELECT statement returns the value 1 is a string. For comparison operators or other expressions, the resulting data type depends on the rules of data type precedence.Īs an example, the following script defines a variable of type varchar, assigns an int type value to the variable, then selects a concatenation of the variable with a string. For implicit conversions, assignment statements such as setting the value of a variable or inserting a value into a column result in the data type that was defined by the variable declaration or column definition. When SQL Server performs an explicit conversion, the statement itself determines the resulting data type. While the above chart illustrates all the explicit and implicit conversions that are allowed in SQL Server, it does not indicate the resulting data type of the conversion. There is no implicit conversion on assignment from the sql_variant data type, but there is implicit conversion to sql_variant. These include xml, bigint, and sql_variant. The following illustration shows all explicit and implicit data type conversions that are allowed for SQL Server system-supplied data types. Use CONVERT instead of CAST to take advantage of the style functionality in CONVERT.
#Layouteditor datatype code#
Use CAST instead of CONVERT if you want Transact-SQL program code to comply with ISO. For example, the following CAST function converts the numeric value of $157.27 into a character string of '157.27': CAST ( $157.27 AS VARCHAR(10) ) The CAST and CONVERT functions convert a value (a local variable, a column, or another expression) from one data type to another. SYSDATETIME() implicitly converts to date style 21.Įxplicit conversions use the CAST or CONVERT functions. GETDATE() implicitly converts to date style 0. For example, when a smallint is compared to an int, the smallint is implicitly converted to int before the comparison proceeds. SQL Server automatically converts the data from one data type to another. Implicit conversions are not visible to the user. Implicit and explicit conversionĭata types can be converted either implicitly or explicitly. When you convert between an application variable and a SQL Server result set column, return code, parameter, or parameter marker, the supported data type conversions are defined by the database API.
When data from a Transact-SQL result column, return code, or output parameter is moved into a program variable, the data must be converted from the SQL Server system data type to the data type of the variable.
When data from one object is moved to, compared with, or combined with data from another object, the data may have to be converted from the data type of one object to the data type of the other.
With the build-in photomask service you will have access to photomask production facilities around the globe for high quality photomasks of any kind.Data types can be converted in the following scenarios: The LayoutEditor will also help you in this area. Once a design is finished photomasks are required to produce the device you have designed. So even huge designs are painted with a acceptable performance. With bigger designs a lack of performance is automatically detected and scarcely visible details are omitted. Medium sized designs (up to several hundred MB of GDS file size, exact size may depend on the design) can be painted with all details in real time. Also the painting performance is excellent and can easily compete with any other tool. So for example multi Gb GDSII files can be loaded in seconds. All significant features of the LayoutEditor are optimized to handle huge designs. Via LayoutEditor python module you can embed the LayoutEditor as a off screen tool or with its graphical user interface in your own Python application.Īs designs can extend to several Gb in file size, perfomance is an important factor.
#Layouteditor datatype download#
A wide range of ready to use macros can be download at our macro market. Macros can be added in the menu structure for a perfect integration of own created extension. Macros are written in the most common language C/C++. This makes creating macros very simple and reduces the time to learn programming a lot. So, with the LayoutEditor it is possible to record macros from the user interface like some office programs can do. It can be used for different applications. As a matter of course macros or scripts are possible with the LayoutEditor.

0 notes
Text
JavaScript Date 獲取日子的方法

日期對於人類現實生活和電腦世界都非常重要,時間的正確和一致性,才不會讓程式產生錯誤或誤解。因此,我們必須要熟識JavaScript Date 獲取日子的方法。
getFullYear() 以四位數字形式獲取年份 (yyyy) getMonth() 以數字形式獲取月份 (0-11) getDate() 以數字形式獲取日數 (1-31) getHours() 獲取小時 (0-23) getMinutes() 獲取分鐘 (0-59) getSeconds() 獲取小時秒數 (0-59) getMilliseconds() 獲取毫秒 (0-999) getTime() 獲取時間(自 1970 年 1 月 1 日以來的毫秒數) getDay() 以數字形式獲取工作日 (0-6) Date.now() 獲取時間 (ECMAScript 5)
同理 JavaScript Date 亦有類似的 Methods 可以獲取 UTC 日期 (Universal Time Zone dates): getUTCDate() 類似 getDate(), 但返回 UTC 日期 getUTCDay() 類似 getDay(), 但返回 UTC 日數 getUTCFullYear() 類似 getFullYear(), 但返回 UTC 年份 getUTCHours() 類似 getHours(), 但返回 UTC 小時 getUTCMilliseconds() 類似 getMilliseconds(), 但返回 UTC 毫秒 getUTCMinutes() 類似 getMinutes(), 但返回 UTC 分鐘 getUTCMonth() 類似 getMonth(), 但返回 UTC 月份 getUTCSeconds() 類似 getSeconds(), 但返回 UTC 秒數
善用好JavaScript Date 獲取日子的方法,不同程式內部不會運算錯誤,給予大眾使用者也可大大減少誤解。
0 notes
Text
Use of Date format in where clause in MS SQL Server
Use of Date format in where clause in MS SQL Server
Example of using Date format in Where or Select clause in MSSQL Server Example to show cast varchar to date and use varchar date in where clause of MS SQL SERVER --Check date format: select getdate() 2022-04-05 19:58:38.337 -- Use CAST function to convert varchar datatype to Datetime: select cast('2022-04-15' as datetime) 2022-04-15 00:00:00.000 --Example of Using Convert to show different…
View On WordPress
0 notes