Viewing 15 posts - 256 through 270 (of 371 total)
Thank you for the explanation, Jeff.
I was getting errors when trying to make use of BCP or BULK INSERT with that format and I wondered what I was doing wrong.
Best...
October 7, 2011 at 3:25 pm
Nice question.
I thought there was a catch somewhere but there wasn't. 😀
Thank you.
Best regards,
October 7, 2011 at 5:34 am
Jeff Moden (10/6/2011)
Ah... yeah... found it...
That's brilliant! Thank you.
Bookmarked. 🙂
Best regards,
October 7, 2011 at 5:11 am
Jeff Moden (10/6/2011)Done correctly, the study programs for certs are an incredible path to knowledge... but certs aren't the only path available.
Indeed. You're absolutely right.
There's something I'd like to ask...
October 6, 2011 at 7:41 pm
mendesm (10/5/2011)
Caro compatriota,
Yes, there were generalizations in there, but my point wasn't that if one is not qualified without experience, but rather that one can be very qualified, without experience,...
October 5, 2011 at 8:16 pm
IMHO you should start being curious about the dba side of your company even if it doesn't have a proper DBA. And as many have stated, some DBAs start out...
October 5, 2011 at 8:14 pm
mendesm (10/5/2011)
These days, the more...
October 5, 2011 at 7:51 pm
Jeff Moden (10/3/2011)
The BCP format file would use similar delimiters and row terminators as you have in your BULK INSERT example (which is very nicely done, BTW). Perhaps if...
October 3, 2011 at 7:58 pm
Jeff Moden (10/2/2011)
October 2, 2011 at 10:43 pm
Jeff Moden (10/2/2011)
codebyo (10/1/2011)
But...
October 2, 2011 at 2:25 pm
Jeff Moden (10/2/2011)Same goes with conversions to VARCHAR(MAX) which is serious overkill for 7 digit conversions. In many cases, just switching from VARCHAR(n) to VARCHAR(MAX) will cause performance to...
October 2, 2011 at 1:16 pm
Jeff Moden (10/2/2011)
codebyo (9/27/2011)
Day of week would be like this:
SELECT CASE DATEPART(WEEKDAY, '20110901')
...
October 2, 2011 at 1:08 pm
How about registering a linked server?
Then you could do something like this:
INSERT INTO LocalServerName.DatabaseName.SchemaName.TableName(<columns>)
SELECT <columns> FROM LinkedServerName.DatabaseName.SchemaName.TableName;
More information here: http://msdn.microsoft.com/en-us/library/ms188279.aspx
And here: http://msdn.microsoft.com/en-us/library/aa213778(v=sql.80).aspx
Best regards,
October 1, 2011 at 5:52 pm
Now if you need to pass the filename as a variable you won't be able to use OPENROWSET that way. It needs a constant value as filename.
But you could do...
October 1, 2011 at 5:21 pm
This may be one of the simplest ways to import a text file:
DECLARE @TxtData VARCHAR(MAX);
SELECT @TxtData = BulkColumn FROM OPENROWSET(BULK 'C:\textfile.txt', SINGLE_CLOB) AS T;
SELECT @TxtData;
But, as other have mentioned, you...
October 1, 2011 at 5:10 pm
Viewing 15 posts - 256 through 270 (of 371 total)