Viewing 15 posts - 451 through 465 (of 1,217 total)
It is pretty nasty thing to do it on SQL Server, but if it is really necessary, here you go:
DECLARE @value INT
SET @value = 1234567
SELECT @value as orig_value,
CONVERT(VARCHAR(20), CONVERT(money,@value),1)...
January 12, 2007 at 5:36 am
Hi,
lots of info, explanations, tests of performance and various solutions can be found at Erland Sommarskog's pages
You will find several articles there that apply to your situation, especially
January 12, 2007 at 5:19 am
If you don't have Numbers and Dates tables yet, you can create them now.
CREATE TABLE Numbers
( Number INT NOT NULL,
CONSTRAINT PK_Numbers
PRIMARY KEY CLUSTERED (Number)
WITH FILLFACTOR = 100)
INSERT INTO Numbers
SELECT (a.Number *...
January 11, 2007 at 8:35 am
Hi,
the column list in INSERT INTO needs to be in parentheses, and it has to be followed by SELECT (or VALUES).
If you want to skip certain column (not insert anything...
January 11, 2007 at 4:55 am
The linked article shows some useful info, but I'm not sure it applies to you. That depends on what you consider as "UPDATE".
For the sake of IF UPDATE(column) and...
January 11, 2007 at 1:43 am
I agree, most probably the problem is caused by missing quotes (although without DLL it is just a guess - but both posted tables use CHAR on all columns):
and (rptPXA2.DCode)...
January 9, 2007 at 9:01 am
Well, I already posted that above, Arthur... If the only column of a view is defined like this:
SELECT doctype+
LEFT(ISNULL(docname,'')+space(25),25)+space(3)+
LEFT(ISNULL(phone,'')+space(18),18) +
LEFT(ISNULL(deanumber,'')+space(9),9)+CHAR(13)+CHAR(10)+
LEFT(ISNULL(statelicense,'')+space(15),15)+
LEFT(ISNULL(street,'')+space(30),30) as myexp
FROM #export
then export into fixed length text file...
January 9, 2007 at 7:51 am
In 99% of cases, cursor is not necessary. If you need to store the result, better do it in a table (permanent or temporary) or table variable. Make the INSERT...
January 9, 2007 at 3:23 am
If you want to return only one row for each row in table A, then you have to decide what should happen to the rest of data selected with the...
January 9, 2007 at 3:02 am
If I would need to write such CASE for some reason, I would prefer not to use LIKE (that only makes sense if you are searching for a pattern, i.e. part...
January 9, 2007 at 2:34 am
Hello Karthikeyan,
These forums are here to help those who work with SQLS and encounter some problem with which they need assistance. Your questions show that you don't know anything about SQL Server...
January 9, 2007 at 1:40 am
I still don't understand why you need to create several views (you can export 2 lines of text from 1 row of a view), but if you are happy with this...
January 9, 2007 at 1:23 am
Create composite unique index on columns A,B,C (not necessarily in this order - use the most selective column as first).
When inserting, check whether a row with the same values exists or not....
January 8, 2007 at 2:39 am
Is this a plain insert that you are talking about, or does it contain lots of joins and/or a where clause? It could also be that it isn't the insert...
January 8, 2007 at 1:02 am
Viewing 15 posts - 451 through 465 (of 1,217 total)