Viewing 15 posts - 2,011 through 2,025 (of 6,036 total)
hmm, it did not quite explain the problem.
At least to me.;-)
Can you please provide some data samples where the script fails and explain what outcome you'd expect from it.
Then I...
April 23, 2013 at 6:46 pm
Now, what is wrong with the approach I posted?
Where does it fail to provide the result you need?
April 23, 2013 at 4:19 am
First, you need to have some kind of ID on the records in the table, otherwise each record will be always matched to itself.
Assuming, you have such ID here is...
April 22, 2013 at 9:10 pm
Lynn Pettis (4/19/2013)
try this:
There must be a typo after @MAX_NUMBER:
SET @QUERY='SELECT @MAX_NUMBER = MAX('+@DB_NAME+'.'+@SCHEMA_NAME+'.'+@TABLE_NAME+'.'+@COLUMN_NAME+') FROM '+@DB_NAME+'.'+@SCHEMA_NAME+'.'+@TABLE_NAME
And, it's a good habit to prevent a possibility of an...
April 21, 2013 at 5:43 pm
Chrissy321 (4/18/2013)
Am I over complicating the string extraction? I want the text between the first and second occurrences of '.'DECLARE @paths TABLE(path varchar(50))
INSERT INTO @paths
SELECT '.ab.qwer.poi' UNION
SELECT '.1.qwerty.ab' UNION
SELECT '.1234567890.asd.a'
See...
April 18, 2013 at 6:14 pm
mister.magoo (4/9/2013)
Here's some code to generate a Broadcast Calendar table:
That's the way!
You runt it once and you use the outcome (data in the table) indefinitely.
And if the angry boss comes...
April 10, 2013 at 10:46 pm
j.miner (4/10/2013)
Hi Kalpit,A quick solution is below.
John, I copied your syntax to my reply and only after posting I realised - it's wrong.
Parameters in stored procedures do not require brackets:
CREATE...
April 10, 2013 at 9:13 pm
It's pretty common to find strings like that in syscomments:
/*
The procedure updates values stored in table SessionValues
*/
CREATE Procedure abc_SessionValuesUpdate (a int) AS
SET NOCOUNT ON
BEGIN
UPDATE SessionValues SET Value = @Value...
April 10, 2013 at 8:38 pm
Check Distributed Transaction Coordinator status.
April 10, 2013 at 5:47 am
This would do the same:
SELECT
TOP 100
comp_id, sup_code, sup_name, sup_ac_code, '0a1705011715553107773972'
FROM
comp_ac
ORDER BY
comp_id
It does not seem to make...
April 9, 2013 at 11:28 pm
select top 5 PATINDEX ('%waitresource=OBJECT%', TextData)
, substring(TextData, PATINDEX ('%waitresource="OBJECT%', TextData) + LEN('waitresource="OBJECT')+1, 20)
April 9, 2013 at 11:15 pm
convert(varchar, TextData)) does not have the length of varchar soecified.
By default it's equal to convert(varchar(30), TextData)).
And actually you do not need to convert Textdata at all.
Use PATINDEX instead of...
April 9, 2013 at 11:08 pm
Peter E. Kierstead (2/20/2008)
April 9, 2013 at 10:56 pm
sqlpadawan_1 (4/8/2013)
April 9, 2013 at 8:27 pm
On my desktop (2k8) both queries perform equally:
(1 row(s) affected)
SQL Server Execution Times:
CPU time = 141 ms, elapsed time = 148 ms.
(1 row(s) affected)
SQL...
April 9, 2013 at 8:19 pm
Viewing 15 posts - 2,011 through 2,025 (of 6,036 total)