Posts by Rodrigo Nascentes • 56 points
7 posts
-
0
votes1
answer20
viewsA: Compare SQL Server users to AD users
Hello @rafaabell, you can use the stored system processor sp_validatelogins to display the logins of Windows employees who no longer exist and still remain in the SQL Server instance. EXEC…
-
1
votes1
answer31
viewsA: How to create an alias in Powershell?
Example: function Get-SystemBootTime{ systeminfo | find "System Boot Time" } Set-Alias -Name bt -Value Get-SystemBootTime Running the alias: PS > bt System Boot Time: 7/20/2021, 8:49:23 AM…
powershellanswered Rodrigo Nascentes 56 -
0
votes1
answer25
viewsA: Sqlserver Field Identity jumps to 1001
From the SQL Server 2012 version, for performance reasons, the values IDENTITY are cached and some of these values may be lost during a database crash or when the server restarts, thus resulting in…
-
0
votes1
answer39
viewsA: Refresh a column every 2 hours
For addition assignment in SQL Server you can use the operator += UPDATE Produtos_Offer SET Valor += 1 WHERE x_Item = 0267 It has the same effect as: UPDATE Produtos_Offer SET Valor = Valor + 1…
sql-serveranswered Rodrigo Nascentes 56 -
1
votes1
answer42
viewsA: Is there the possibility of data loss while converting text data types to nvarchar(max)?
If your database version is smaller than SQL Server 2019, use NVARCHAR(max) to minimize conversion problems. Basic implementation of both types TEXT and VARCHAR(max) is practically the same but with…
-
2
votes1
answer425
viewsA: Is there a difference in performance between INNER JOIN and CROSS APPLY?
Douglas, INNER JOIN compares the rows of two tables based on a condition specified in the query. This type of Join is used at the intersection of lines that has the same value in a column (or more…
-
-1
votes2
answers972
viewsA: How to Use an UPDATE within IF ELSE SQL Server
Place ALTER TABLE as dynamic SQL in the ELSE block. EXEC sp_executeSQl N'ALTER TABLE BANCO_DE_DADOS..MinhaTabela ADD [CodZona] [int] NULL'