|
|
Browse by Tags
All Tags » SQL Server 2005 » T-SQL
-
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 ...
-
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 ...
-
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, ...
-
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 ...
-
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 ...
-
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 ...
-
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 ...
|
|
|