Viewing 15 posts - 1,021 through 1,035 (of 1,491 total)
Make sure you have the semi-colon in front of the WITH.
Also, make sure you are running on at least a SQL2005 machine with a DB in 2005 compatibility mode.
February 6, 2009 at 2:53 am
1. You want to search for SQL String Concatenation. I have given you one technique.
As string concatenation in TSQL is a bit of a fiddle you may want to return...
February 5, 2009 at 9:38 am
Your schema is not very good but you can obtain your result like:
-- *** Test Data ***
DECLARE @bo-2 TABLE
(
    DDS char(2) NOT NULL
    ,BOCleared int NOT NULL
    ,BOClearedDate datetime NOT NULL PRIMARY KEY
)
INSERT...
February 5, 2009 at 9:16 am
This may be more random. It may be better to do this in the middle tier or with a cursor.
-- *** Test Data ***
DECLARE @t TABLE
(
    TId int IDENTITY NOT NULL...
February 5, 2009 at 8:39 am
This may not be particularly random.
-- *** Test Data ***
DECLARE @t TABLE
(
    TId int IDENTITY NOT NULL PRIMARY KEY
    ,bit1 bit NOT NULL
    ,bit2 bit NOT NULL
    ,bit3 bit NOT NULL
    ,bit4 bit NOT NULL
    ,bit5...
February 5, 2009 at 7:02 am
You only need to explicitly release the lock if you set it as a SESSION lock otherwise the it will last for the rest of duration of the connection.
Thanks for...
February 4, 2009 at 5:38 am
Robert - App Locks can be made to apply to the current session and not just the current transaction. It is then up to you to explicitly release the lock...
February 4, 2009 at 4:54 am
As serializing will block inserts for other sessionIds, I would be inclined to use an
application lock.
(If the majority of your upserts are updates, I suspect replying on a CATCH block...
January 30, 2009 at 5:02 am
After briefly scanning the post:
1. GO is not a SQL command but a batch terminator in the tools. Try getting rid of it.
2. @CRLF should be char(13) + char(10)
January 29, 2009 at 10:41 am
1. You failed to copy and paste correctly from the following
http://www.sqlservercentral.com/Forums/Topic644782-1291-1.aspx#bm644794
2. if ((select @z) <= 10) should be if (@z <= 10)
3. Why bother with cursors? Try something like:
DECLARE @SQLString...
January 28, 2009 at 8:55 am
-- *** Test Data ***
CREATE TABLE test
(
    [Name] varchar(20) NOT NULL
)
INSERT INTO test
SELECT 'Name1' UNION ALL
SELECT 'Name2' UNION ALL
SELECT 'Name1' UNION ALL
SELECT 'Name2'
-- *** End Test Data ***
DECLARE @y varchar(20)
    ,@z int
    ,@SQLString...
January 28, 2009 at 4:50 am
Your question is not clear.
To get decent answers you will need to post:
1. test Data - missing.
2. your query - done.
3. your results - done.
4. expected results - missing.
You query...
January 28, 2009 at 3:28 am
DECLARE @LCFId int
SELECT @LCFId = MAX(ClientFileNumber)
FROM dbo.myTable
RETURN @LCFId
I hope you are not incrementing the result and writing it as the next FileNumber!
January 14, 2009 at 3:08 am
SELECT CONVERT(datetime, '01 ' + REPLACE(SourceDate, '-', ' '), 106)
January 13, 2009 at 9:45 am
r.hensbergen (1/13/2009)
In any join, only = should be used.
This is not what Jeff's article says.
In this case the main join criterion is [Order]. In the triangular part of the join...
January 13, 2009 at 9:16 am
Viewing 15 posts - 1,021 through 1,035 (of 1,491 total)