Find any Text in any Stored Procedure

Paopatsin/ April 2, 2021/ Database, MS SQL, Technology

Please read our Disclaimer Works With-Microsoft SQL Server 2016 (RTM) – 13.0.1601.5 (X64)-Microsoft SQL Server 2014 (SP3-GDR) (KB4532095) – 12.0.6118.4 (X64) In case you need to find a certain text, a word or a string in your stored procedure assemblage, the following command will come in handy. Command: SELECT routine_name, routine_definition FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_definition LIKE ‘%<replace with your text>%’

Read More

Enable Shell Command in your Microsoft SQL Database Server

Paopatsin/ November 29, 2020/ Database, MS SQL, Technology

Please read our Disclaimer Works With-Microsoft SQL Server 2016 (RTM) – 13.0.1601.5 (X64)-Microsoft SQL Server 2008 (RTM) – 10.0.1600.22 (X64) As a Database Administrator, there are occasions that you would be needing to interact with the operating system from your SQL Management Studio such as running a dir check or you need to do a file import using the bcp utility

Read More

Count the Number of Records for each Database Tables in MS SQL

Paopatsin/ October 24, 2020/ Database, MS SQL, Technology

Please read our Disclaimer Works With-Microsoft SQL Server 2016 (RTM) – 13.0.1601.5 (X64)-Microsoft SQL Server 2008 (RTM) – 10.0.1600.22 (X64) In case you need a quick run of how many records (or rows) are there in your database tables. Command: Steps and Sample Usage: Open and log into your SQL Management Studio Open a New Query Windows or (CTRL+N) Copy

Read More

Search a Value from any Columns in any SQL Tables

Paopatsin/ October 9, 2020/ Database, MS SQL, Technology

Please read our Disclaimer Works With-Microsoft SQL Server 2016 (RTM) – 13.0.1601.5 (X64)-Microsoft SQL Server 2008 (RTM) – 10.0.1600.22 (X64) Savra, our new database engineer needs to check existence of a certain keyword on the database. So she went for it… Command: Steps and Sample Usage: Open and log into your SQL Management Studio Open a New Query Windows or

Read More

How to Check when a Table was Last Updated

Paopatsin/ August 22, 2020/ Database, MS SQL, Technology

Please read our Disclaimer Works With-Microsoft SQL Server 2016 (RTM) – 13.0.1601.5 (X64)-Microsoft SQL Server 2008 (RTM) – 10.0.1600.22 (X64) Command: SELECT OBJECT_NAME(OBJECT_ID) AS DatabaseName, last_user_update, * FROM sys.dm_db_index_usage_stats WHERE database_id = DB_ID(‘[replace with your database name]’) AND OBJECT_ID = OBJECT_ID(‘[replace with your table name]’) Steps and Sample Usage: Open and log into your SQL Management Studio Open a New

Read More

How to Join Unrelated SQL Tables

Paopatsin/ August 22, 2020/ Database, MS SQL, Technology

Please read our Disclaimer Works With-Microsoft SQL Server 2016 (RTM) – 13.0.1601.5 (X64) Command: SELECT d.*, p.* FROM [AdventureWorks2016].[HumanResources].[Department] d JOIN [AdventureWorks2016].[Person].[Person] p ON 1 = 1 Steps and Sample Usage: Open and log into your SQL Management Studio Open a New Query Windows or (CTRL+N) Run the following commands: (Copy and Paste the code block to your Query Window)

Read More

How to Update Microsoft SQL Account Password

Paopatsin/ August 16, 2020/ Database, MS SQL, Technology

Please read our Disclaimer Works With-Microsoft SQL Server 2016 (RTM) – 13.0.1601.5 (X64)-Microsoft SQL Server 2008 (RTM) – 10.0.1600.22 (X64) If you are an Database Administrator chances are you’ve came across few request adding new users to the database, aside, the company should have stricter rules implementing security across the organization as such keeping passwords up to date and adherence

Read More

How to Fix [ODBC Driver 13 for SQL Server] SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF]

Paopatsin/ August 15, 2020/ Database, MS SQL, Technology

Please read our Disclaimer Works With-Microsoft SQL Server 2016 (RTM) – 13.0.1601.5 (X64) As a Database Administrator, I’m always a fan of CLI (Command-Line Interface) to run some adhoc administrative commands in administering Microsoft SQL Server and Database. In my case I often use osql or sqlcmd. SQL CLI osql allows you to enter and run Transact-SQL statements, system procedures,

Read More

Extract Table Fields from SQL Database

Paopatsin/ August 15, 2020/ Database, MS SQL, Technology

Please read our Disclaimer Works With-Microsoft SQL Server 2016 (RTM) – 13.0.1601.5 (X64) Although, you can generate table scripts easily using built-in context menu from SQL Database Management Studio, you may want to do it your own way.. the HARD way but FUN way. In this post, we will do that, we will extract the table definition of our database

Read More