Reaching the Outer Limits
What's this error:Arithmetic overflow error converting IDENTITY to data type int? It was a new one to me, but read on to find out what it means.
2002-10-14
7,134 reads
What's this error:Arithmetic overflow error converting IDENTITY to data type int? It was a new one to me, but read on to find out what it means.
2002-10-14
7,134 reads
Ever needed to pause in a SQL script? Or wanted to simulate a long running process for testing? This stored procedure accepts an integer and pauses for that many seconds.
2002-10-04
1,270 reads
Quick and dirty script to generate the required SQL to reinstate permissions on each user object. This can be saved off for DR purposes.
2002-09-24
496 reads
I keep seeing people using CONVERT to convert a date to a varchar in order to do comparison or search queries. I haven't seen a situation yet where DATEDIFF can't be used.
2002-08-29
1,263 reads
Big transactions cause the Tlog to grow.When you do a clean of a large table, the delete statement can cause a very long transactionSometimes it's necessary to prevent this.So we divide one big delete into several little ones.A table with call centre data gets +/- 1-mlj records a day. Every day we run a script […]
2002-08-27
850 reads
Assuming we have the following table (that stores hierarchical data) :CREATE TABLE [staff] ( [employee] [int] NOT NULL , [employee_name] [varchar] (10) NULL , [supervisor] [int] NULL , PRIMARY KEY CLUSTERED ( [employee] ) ON [PRIMARY] , FOREIGN KEY ( [supervisor] ) REFERENCES [staff] ( [employee] ))I ‘ll built a […]
2002-08-23
886 reads
This article shows you how to design the storage for email addresses, how to validate email addresses, how to retrieve demographic information from email addresses efficiently, using computed columns and indexes. It also covers the security aspect of dealing with email addresses.
2002-08-01
1,340 reads
2002-07-19
610 reads
a Basic example of how to manipulate an IDENTITY COLUMN AN HOW TO STOP the automatic counting using SET IDETNTITY_INSERT
2002-07-18
754 reads
procedure is an extended xp called xp_getNetName to get the computer network identifcation name
2002-07-18
801 reads
By Steve Jones
I was experimenting with CHOOSE() recently after I was asked a question. In a...
By DesertDBA
I did not expect 27 responses to my T-SQL Tuesday #204 invitation, but it...
Should you adopt an off-the-shelf AI tool, partner with a specialist, build in-house, or...
Has anyone ever seen this before? I have sysadmin permission on a server. I...
Comments posted to this topic are about the item Switching Schema II
Comments posted to this topic are about the item A Practical Approach to Automating...
I run this query:
SELECT s.name AS schemaname , o.name AS objectname FROM sys.objects o INNER JOIN sys.schemas s ON s.schema_id = o.schema_id WHERE o.name = 'Beer'I get two rows back for the objects, named dbo.beer and etl.beer. Both the tables have identical schemas and are not partitioned. There are 25 rows in dbo.beer and 0 rows in etl.beer. I run this code:
ALTER TABLE dbo.beer switch TO etl.beerWhat happens? See possible answers