Viewing 15 posts - 4,741 through 4,755 (of 5,504 total)
Would it be possible for you to wrap the columns using a string character e.g. " ' "?
Sample data:
CREATE TABLE csv(id int, data varchar(30))
INSERT INTO csv
SELECT 1, 'single value: a'...
November 19, 2009 at 2:22 pm
Or you could replace [pprice] with its original calculated fields (please note that I change your query in terms of ISNULL usage):
select productname, (uprice+sprice) As pprice, IsNull(uprice+sprice,0) As pprice2
from...
November 19, 2009 at 12:10 pm
to load the content of an xml file you could use
DECLARE @xml xml
SET @xml = (SELECT * FROM OPENROWSET(
BULK 'C:\temp\file.xml',
SINGLE_BLOB) AS x)
SELECT @xml
For details...
November 19, 2009 at 11:32 am
If we can ask for anything that new query tool should be able to handle, why not request two functions that would really help:
1) refuse (or at least request special...
November 19, 2009 at 8:45 am
Glad I could help, Jay!!
I'd like to thank you to follow my "hint" on calendar tables and to come up with that nice solution (instead of asking: "How do I...
November 19, 2009 at 2:34 am
What have you tried so far and where you got stuck?
Did you try to left outer join on ItemNumber, ItemLocation and AuditDateTime (maybe even AuditUser) and t1.AuditSequence = t2.AuditSequence -1...
November 18, 2009 at 4:51 pm
SELECT DATEDIFF(year,'2009-12-31 23:59:59.997', '2010-01-01 00:00:00.000')
basically means
SELECT DATEPART(YEAR,2nd value) - DATEPART(YEAR,1st value) -- which is 2010 - 2009 = 1
If you'd like to get difference displayed as "years", but...
November 18, 2009 at 4:03 pm
SQL Noob (11/18/2009)
November 18, 2009 at 1:55 pm
If you'd normalize your table structure it would become easy:
Take your test table, add a primary key and unique constraints on col1 and col2.
This will give you unique combination.
To reference...
November 17, 2009 at 5:29 pm
I'm not sure if you do have a calendar table yet. If not, you really should think about using one. (search for "calendar table" on this site for details).
To show...
November 17, 2009 at 5:09 pm
There are two issues:
#1 get rid of the 'GO' command within your dynamic sql and
#2 use exec(@sql) instead of plain exec @sql (sometimes parenthises matter...)
November 17, 2009 at 7:41 am
Somewhere you have a typo...
What you have:
set langauge english
vs. what you should have:
set language english
langauge is no reserved word. 😉
November 17, 2009 at 5:30 am
Would it be possible for you to show us the execution plan for the modified query (including the creation of the temp table)?
November 16, 2009 at 1:27 pm
Florian Reischl (11/16/2009)
Be careful with joining table valued functions. Especially if the string split function works with schema table like spt_values or a Numbers/Tally table.
Just had some...
November 16, 2009 at 1:15 pm
Viewing 15 posts - 4,741 through 4,755 (of 5,504 total)