Viewing 15 posts - 286 through 300 (of 375 total)
The
SELECT @variable = @variable + myfield
FROM mytable
portion is this undocumented feature Sergiy wrote about.
It allows you to concatenate all myfield values selected by a query into a variable in a...
May 24, 2007 at 7:35 am
I think the problem comes from the 'golden plate'
SELECT @Message = ISNULL(@Message + ',', '') + Z.REP+':'+ Z.INFO
FROM (
SELECT LEFT(SLPRSNID,2) AS REP,INFO
FROM @Stage
WHERE SLPRSNID...
May 24, 2007 at 5:47 am
Actually I was referring to you first post while you were adding that little bonus of the concatenation when you do a select into a variable.
May 23, 2007 at 8:40 pm
Sergiy,
do you always hand out everything on a golden plate?
May 23, 2007 at 8:16 pm
I don't know if I understand the problem correctly but if you question why your @message is NULL at the end of the loop then the answer is because it is...
May 23, 2007 at 8:04 pm
Well. In a case when you have limited amount of data that fits into single page creating an index will decremet the performace because you will ask the server to...
May 23, 2007 at 6:39 pm
I think you could access the sysfiles directly if what you mean by accessing is reading their content. Actually I would advice anyone to learn about them and use them as...
May 23, 2007 at 3:00 pm
You should be able to do it using something like this
ALTER TABLE yourtable DROP CONSTRAINT yourconstraint, COLUMN yourcolumn
you can also list any indexes you have this column tided up to.
If you want...
May 23, 2007 at 2:49 pm
I don't know if it was apparent from the previous posts but you should be fine if you change this
SELECT @sql = 'SET IDENTITY_INSERT ' + @tablename + '...
May 23, 2007 at 7:31 am
I don't know if I understand you correctly but I think you could get the records combined by using something like this
INSERT INTO realtable
(
...your fields....
)
SELECT
item,
branch,
month,
source
SUM(inv_value),
SUM(cme_value)
FROM mc_staging
WHERE ...your condition...
GROUP...
May 23, 2007 at 7:23 am
Depending on your particular case you could do the following:
Create a table that will hold all the holidays
CREATE TABLE Holidays (holiday SMALLDATETIME)
Populate this table with all holidays that do not...
May 22, 2007 at 10:45 am
Jeff,
I came up with somewhat similar code but I didn't have the + 1 in the first line. Otherwise there is 1 business day between today and today and I...
May 22, 2007 at 6:52 am
I am glad I could help a bit. Views can be very sensitive and tricky. Sometimes they don't aways work as you would expect them to, especially when you start joining them.
May 21, 2007 at 9:15 am
Do you need to deal with holidays as well or do you want to exclude Saturdays and Sundys only?
May 18, 2007 at 8:27 am
I don't know if this is a viable solution but one of the things you could do is to create a table with something like this
CREATE TABLE itemmultiplier (...
May 18, 2007 at 8:21 am
Viewing 15 posts - 286 through 300 (of 375 total)