blogs.conchango.com

welcome to the conchango blogging site
Welcome to blogs.conchango.com Sign in | Join | Help
in Search

Browse by Tags

All Tags » SQL Server 2005 » T-SQL
  • T-SQL IDENTITY : Fun and Games with DBCC CHECKIDENT

      This issue caught me out today whilst putting together some build scripts for reference data. So I thought I’d share it. USE [tempdb] GO CREATE TABLE [dbo].[Table_1](       [Col1] [int] IDENTITY(1,1) NOT NULL,       [Col2] [char](1) NOT NULL ) ON [PRIMARY] GO delete from ...
  • SQL Server 2005: Passing variables into an OPENQUERY argument

    Today I ran into a blocker when trying to do this. Having spent a reasonable amount of time taking all of my sql statements out of the OPENQUERY argument and putting them into a string variable I then found it didn't work. The reason (from BOL) it turns out is that, and I quote; "OPENQUERY does not accept variables for its ...
    Posted to Jim 2.0 (Weblog) by James.Pipe on June 28, 2007
  • SQL Server 2005: View all permissions (2) - Explode the roles!

    Two days ago I posted a blog entry here that showed how the following SQL statement:   select dp.NAME AS principal_name,           dp.type_desc AS principal_type_desc,           o.NAME AS object_name,           ...
    Posted to SSIS Junkie (Weblog) by jamie.thomson on February 9, 2007
  • SQL Server 2005 Query Performance addendum

    In response to my recent post about analyzing query performance in SQL server 2005, my colleague Mr Rowland Jones emailed me a couple of additional points around best practice, which will further aid query performance. Here are the points he makes (in his very own words) Owner Qualification When writing the table names in your queries it is ...
    Posted to Jim 2.0 (Weblog) by James.Pipe on February 9, 2007
  • SQL Server 2005: View all permissions

    Today I was asked how one can query the server to list out all permissions that a principal has on all the securables in a SQL Server database. After 10 mins of searching through BOL I came up with the following that seems to work quite well:    1 select dp.NAME AS ...
    Posted to SSIS Junkie (Weblog) by jamie.thomson on February 9, 2007
  • Analysing Query Performance in SQL Server 2005

    Sometimes I will be writing a query and will be faced with the option of writing it in a number of different ways, each of which will give me the result I’m looking for, and the question I always ask is which is most efficient? Now ‘most efficient’ is an ambiguous term to an extent, because we could mean fastest run time, or ...
    Posted to Jim 2.0 (Weblog) by James.Pipe on February 3, 2007
  • T-SQL: Generate a list of dates

    Sometimes we can be working and we write or find a ridiculously simple bit of code that we know will be useful in the future, then we just go ahead and plain forget all about it. When I find such stuff I like to stick it on my blog so that I know where to find it in the future and also on the off chance that someone else might ...
    Posted to SSIS Junkie (Weblog) by jamie.thomson on January 11, 2007
Powered by Community Server (Personal Edition), by Telligent Systems