Skip to main content

Posts

Showing posts from August, 2017

Creating SQL statements From excel

                                            Creating statements From excel Automatically For Insert Statements, ="INSERT INTO DR_Prices VALUES("&A5&",'"&B5&"',"&C5&","&D5&","&E5&","&F5&","&G5&","&H5&","&I5&","&J5&","&K5&","&L5&","&M5&","&N5&","&O5&")" If we have a requirement wherein same kind of statements needs to be created with same count of columns then they can be generated in Excel using statement, ="exec sp_addmessage @msgnum='"&A4&"',@severity='"&C4&"',@with_log='"&D4&"',@msgtext='"&E4&"'" NOTE: Above statement is to insert into sys.messages table in Master DB. Insert sta

Active Node

                                                         Active Node in a Cluster Def : This script when run sends a mail whenever there is a change in the active node on which the SQL instance is currently running. Please find the below link for code. https://gist.github.com/tejaswidatla/164e528d8a5b83687a5f892c9b41d9d6 NOTE: Passive node is one that does not have any active service running on it (just like with SQL server services may not be running on passive node but that doesn't mean passive node can be offline). There is a quoram disk which has data on how the drive mapping must happen when the services failover.