This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| EXEC sp_resetstatus 'test_dr'; | |
| ALTER DATABASE test_dr SET EMERGENCY | |
| DBCC checkdb('test_dr') | |
| ALTER DATABASE test_dr SET SINGLE_USER WITH ROLLBACK IMMEDIATE | |
| DBCC CheckDB ('test_dr', REPAIR_ALLOW_DATA_LOSS) | |
| ALTER DATABASE test_dr SET MULTI_USER | |
| DBCC CheckDB ('test_dr') | |
| ALTER DATABASE test_dr SET Online |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WITH Items | |
| AS ( | |
| SELECT 1 AS ID | |
| ,CodingDepartment_ID | |
| ,CodingBrand_ID | |
| ,K_Name | |
| ,K_Bar_Code | |
| ,K_Desc | |
| ,IsActive | |
| ,ProviderMainAccount_ID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DECLARE @minUserImpact INT = 50 | |
| DECLARE @minUserSeeks INT = 100 | |
| SELECT MIGS.last_user_seek | |
| ,MIGS.avg_user_impact | |
| ,MIGS.avg_total_user_cost | |
| ,MIGS.user_seeks | |
| ,MIGS.user_scans | |
| ,MIGS.avg_user_impact * MIGS.avg_total_user_cost * (MIGS.user_scans + MIGS.user_seeks) AS Benefit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT s.name AS 'schema', ts.name AS TableName, | |
| c.name AS column_name, c.column_id, | |
| SCHEMA_NAME(t.schema_id) AS DatatypeSchema, | |
| t.name AS Datatypename | |
| ,t.is_user_defined, t.is_assembly_type | |
| ,c.is_nullable, c.max_length, c.PRECISION, | |
| c.scale | |
| FROM sys.columns AS c | |
| INNER JOIN sys.types AS t ON c.user_type_id=t.user_type_id | |
| INNER JOIN sys.tables ts ON ts.OBJECT_ID = c.OBJECT_ID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| init_uart_clock=16000000 # set uart clock to 16mhz | |
| kernel_old=1 # load kernel.img at physical memory address 0x0 | |
| safe_mode_gpio=8 # a temp firmware limitation workaround | |
| max_usb_current=1 # enable maximum usb current | |
| gpu_mem=32 | |
| hdmi_force_hotplug=1 # enable hdmi display even if it is not connected (640x480) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --The APPLY operator should do the trick: | |
| SELECT * | |
| from MarketDataMaster | |
| cross apply dbo.fn_MarketDataDetails (MarketDataMasterID) | |
| --This essentially calls the function once per row returned from MarketDataMaster. "cross apply" works like an inner join, in that only rows for which data is returned by the function will be returned; use "outer apply" for functionality similar to left outer joins. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Configuration; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using WinSCP; | |
| namespace YOURPROJECTNAMESPACE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void RunCmd(string command) | |
| { | |
| System.Diagnostics.Process proc = new System.Diagnostics.Process(); | |
| proc.StartInfo.FileName = "app name like bcp"; | |
| proc.StartInfo.Arguments = command; | |
| proc.Start(); | |
| proc.WaitForExit(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Configuration; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace YOURPROJECTNAMESPACE | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Newtonsoft.Json; | |
| using Newtonsoft.Json.Linq; | |
| using StackExchange.Redis; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Configuration; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading; |