Viewing 15 posts - 7,501 through 7,515 (of 7,545 total)
Essentially, @tbl is not getting populated with the first "insert to @tbl"
The INSERT will not, and should not, be reflected in the table until the statement has finished....
September 26, 2007 at 7:37 am
If it's not running from SQL, how does it even have a spid? I thought spid was used by SQL, kpid was used by Windows.
May 24, 2007 at 8:38 am
>> I'm pretty sure that when OSQL is used, any procs called by it are given the same spid. <<
Yes, of course.
But the osql task itself will have a...
May 24, 2007 at 8:13 am
The index should be on the search column(s), not on an id column.
May 23, 2007 at 12:41 pm
Yes, if you want to add an index to a small table, and you should for many of them, always make it a unique, clustered index. For example, for the sample...
May 23, 2007 at 10:21 am
I thought the osql was a separate process and so would get its own spid. How will you know which row in the table the child process needs to get?
May 23, 2007 at 10:15 am
Probably easiest is to do something like this (handles up to 24000, assuming PRINT can handle that):
print space(@hangingIndent) + replicate(@startCharacter, CASE WHEN @widthOfPattern > 8000 THEN 8000 ELSE @widthOfPattern END)...
May 23, 2007 at 8:28 am
>> I suggest you make them both nonclustered indexes. Your inserts and queries will move along alot faster. <<
That depends on the queries. For example, if you always specify a...
May 23, 2007 at 8:21 am
Very interesting article, definitely worth seeing.
Btw, though, shouldn't the columns be NCHAR(2) instead of NVARCHAR(2)? It's a waste of space and processing overhead to make a 2-byte column variable.
May 21, 2007 at 7:59 am
Excellent article!
Regarding the commission example, to consider something specific, I would prefer to explicitly know that a commission does not apply. Therefore, I might add a "IsCommissionEligible" BIT column. This is, most...
April 10, 2007 at 10:11 am
You also need to add an ORDER BY, otherwise you can't be sure the code rows will be returned in sequence:
SELECT ...
ORDER BY id, colid
March 23, 2007 at 7:52 am
If the base table is small, you can do this:
SELECT *
FROM #tmpSumTest
UNION ALL
SELECT CAST(SUM(number) AS DECIMAL(19, 8))
FROM #tmpSumTest
If not small, you can make the main query a subquery, adding...
March 22, 2007 at 7:43 am
Yes, you'll have to change the query for that.
To get tables with '%school%' in them:
1) AND must match all the other criteria, do this:
WHERE o.name LIKE N'%school%'
AND o.xtype = ''U'' AND o.name...
March 5, 2007 at 12:08 pm
I assume you know the column type is char/varchar/nchar/nvarchar. If not, remove the check for "%char%"; if you know it's varchar, naturally you can change it to "%varchar%".
For one db:
SELECT...
March 1, 2007 at 8:37 am
Viewing 15 posts - 7,501 through 7,515 (of 7,545 total)