Monthly Archives: February 2013

SQL Server Script to identify a column in a database

In this post I would like to use the below script to identify if a specific column exists in a database. For instance I would like to know which tables have the column productdescription in AdventureWorksDW2008R2 database. Below is the tablename with the schemaname and the … Continue reading

Posted in SQL Server DBA Stuff | Tagged , , , , , , , | Leave a comment

Alter column type in SQL Server

Often DBAs get requests to alter the column types of a table. Although it needs to pass through multiple levels of approvals to implement structural changes in a production environment its quite common to get these requests. In this post … Continue reading

Posted in SQL Server DBA Stuff | Tagged , , , , , | Leave a comment

Setting Up Linked Server Between SQL Server 2008 R2 and MAS90 Database

In this post, I would like to discuss how to setup a linked server between SQL Server 2008 R2 and MAS90 server database. The first step before setting up the linked server is to install the MAS90 driver and then … Continue reading

Posted in SQL Server DBA Stuff | Tagged , , , , , , , , , | 3 Comments

SQL Server Script to rename tablenames in a database

Sometimes DBAs get requests to deprecate some tables or get requests to rename tables. Below is the script to rename a table. Hope this helps

Posted in SQL Server DBA Stuff | Tagged , , , , , , , , , | Leave a comment

Send email from SQL Server Agent with results imported to a csv file

Often DBAs get requests to email the results of a query attached to a csv file where the query is running from a SQL Server Agent job. This can be achieved through send email task transformation from SSIS or by … Continue reading

Posted in SQL Server DBA Stuff | Tagged , , , , , | 2 Comments

Grant view any definition and view sql server agent jobs permissions to a group or a user

In my production environment the developers have db_datareader permissions only. The higher management approved that they could now have “view any definition” permission on the production environment. Here is how I granted them the view def. permissions. Here is the … Continue reading

Posted in SQL Server DBA Stuff | Tagged , , , , , , , , | Leave a comment

Grant execute stored proc permissions to a user

In this post I would like to focus on granting a user with execute stored proc permissions who already has read, write and view any definition permissions. 1) Open SSMS–> In the object explorer select the database in which the role … Continue reading

Posted in SQL Server DBA Stuff | Tagged , , , , , | Leave a comment