Viewing 15 posts - 1 through 15 (of 161 total)
The code I use to split out delimited list is:
create function [dbo].[Split](@value nvarchar(max), @delimiter varchar(20))
returns @results table (id int identity(1, 1) primary key, value nvarchar(max))
as
begin
declare @p1 int,
@p2 int
-- ensure value...
August 19, 2009 at 3:23 am
I have attempted to use profiler, but it does not seem to raise an error number (btw, where have all the server messages goine in 2005??).
From what I have managed...
June 23, 2006 at 8:16 am
The data in calculated columns will not add to the storage requirement for the table - it is in effect virtual data. However, by creating the index you will persist...
January 25, 2006 at 9:54 am
Just specify the Calculated column in the where clause and the query optimiser should choose the appropriate index. You can check by looking at the Execution Plan.
Beware that creating too...
January 25, 2006 at 9:33 am
If this was something you were going to be regularly searching for, you could create a calculated column with a formula of:
substring(PartCode, 1, 4)
Then build an index on this calculated...
January 25, 2006 at 9:22 am
Query 1
select friends_name
from freinds
where movie_name='titanic' and borrowed_date<getdate()
Query 2
select friends_name, datediff(d, borrowed_date, getdate()) as DayCount
from friends
where returned_date is null and borrowed_date<getdate()
Hope this helps
January 23, 2006 at 5:01 am
Sorry oversight in previous post that newid() will generate a hex value (i.e. only A-F).
You can use a view to generate the random number and a generic function to construct a...
January 13, 2006 at 5:54 am
Why not just use the newid() function to generate the random string.
declare @MyCode varchar(6)
while @MyCode is null or @MyCode like '%[I,O]%'
set @MyCode = left(convert(varchar(40), newid()),...
January 13, 2006 at 4:22 am
Tertius
If you change you code as highlighted below, your code will work for multiple record inserts - it currently does not.
CREATE TRIGGER trig_Split
ON dbo.SMS
FOR INSERT
AS
UPDATE SMS Set
Part1 = substring(SMS.SMSMessage+ '$',...
May 3, 2005 at 2:00 am
Using mkeast's example (with some minor modifications) you can use the following to test which of these triggers work for multiple rows and which do not.
CREATE TABLE SMS
(
id...
April 27, 2005 at 2:11 am
Farrell
Judiths code would not work if there are more than a single row inserted (i.e. by using an INSERT.... SELECT.... statement).
The part of the code which SET's all the parameters...
April 27, 2005 at 1:52 am
My last post relates specifically to Judith solution, but in hind sight Farrells solution falls foul of the same problem since the @location and @message variables to not take account...
April 26, 2005 at 8:54 am
I am afraid that your solution does not take account of the fact that when a trigger fires it can relate to a set of data (i.e. more than one...
April 26, 2005 at 8:50 am
I know this script uses a cursor, which is not ideal within a trigger, but I think you will find that it should work.....
create trigger SMS_ITrig on SMS...
April 26, 2005 at 2:25 am
Although only a text editor, you could consider using TextPad - it allows you to use a syntax file to markup the text in the same colours as QA, and...
November 12, 2004 at 7:28 am
Viewing 15 posts - 1 through 15 (of 161 total)