Knowledge.ToString()

Category: SQL Server

  • The OLE DB Provider “ORAOLEDB.Oracle” for Linked Server Supplied Inconsistent Metadata for a Column.

    You have setup an Oracle linked server. It seems successful but when you are trying to get the data from Oracle using following simple SQL statement: The Oracle linked server throws following error: You may be scratching your head why it does not work. Here is the reason. Is your Oracle database on Oracle 11g?…

    |

  • TSQL: Split String into Multiple Columns With Built-in Function

    split string into multiple columns using hammer

    Let’s assume that you are working with SQL Server database and you need to build an ad-hoc report and split the string data into separate columns. Your data contains specific delimiter and you want to parse the data into respective columns. For example, your data column FullName contains “LastName, FirstName”, you would like to parse…

    |

  • TSQL: Split Full Name into First Name and Last Name Columns

    If you need to create an ad-hoc report and split full name into first name and last name, online search will suggest to create a custom user defined function. Sometimes, it is not possible to create an user defined function for single ad-hoc report because you need to follow change control process of your organization…

    |

  • Get DATETIME Value From msdb.dbo.sysjobhistory

    If you ever had to work with SQL Job Agent and find out the details about run time for the job/step, you would find it difficult to convert the INT into DATETIME. Here is the quick solution. To get the start date time, use msdb.dbo.agent_datetime function available in SQL Server 2005 onwards. If you are…

    |

  • Stop SQL Server Trace Using SQL Command

    Today I started SQL Profiler and paused it. After some time, none of the buttons were enabled. I can neither resume nor stop the trace. Here are the sql commands that I finally found to stop the trace. Get the trace id Stop trace

    |

  • Change Database Name in SQL Server

    SQL Server Enterprise Manager does not let you change your database name once you create it. If you want to change your database name, you may have to manually run the following script to change it. First of all you have to login to SQL Server using osql command line utility. Once you are in,…

    |