Tag: scripts

  • Index fragmentation Report

    I had to prepare the list of tables having more than 60% fragmentation. I wrote this query to get those information. The below query will give the list of all the fragmented tables in a particular database having more than 60% fragmentation. This will work for SQL 2005 and beyond.

  • Function to Split Comma separated string to Integer

    There are cases where we need to pass the input parameter to the stored procedure as a comma-separated string in order to avoid multiple db calls from happening. This helps in reducing the db calls thereby reducing the load on the db server. The below function will split the given comma-separated string into integers and…

  • Change Transfer Schema for all Objects

    In my working environment we will be using different schema for production and development environments. Our development apps are configured to Dev schema and Production apps are configured to Prod schema, so when we restore the db from production to development environment, all our dev apps stopped working since the objects securable will be using…

  • Adding article to existing publication without generating a full snapshot

    This SP can be used to add articles to the existing publication without starting snapshot for all the tables. When Snapshot is started it will create snapshot only for the newly added article to the publication

  • IP Address Blocking or Restriction in SQL Server

    I have seen some questions in forums asking for the answer is it possible to block connections to SQL Server based on IP address. As far as now there is no official way in SQL Server to block the connections in SQL Server based on IP address. However this can be done from the OS…