Viewing 15 posts - 6,646 through 6,660 (of 7,164 total)
You cannot use variables in your ORDER BY for your column list or the ASC/DESC expression...I tested in 2005 and 2008.
Try it this way:
DECLARE @NEW_SEARCH_STRING VARCHAR(250),
@SORTFIELD...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 15, 2011 at 1:50 pm
Jeff Moden (4/14/2011)
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 15, 2011 at 11:24 am
PS for the record I still think this task would be better off done in PowerShell using WMI (or sc) to avoid having to turn on xp_cmdshell.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 15, 2011 at 10:12 am
Very nice, I completely missed that you were using sc 😀
I fixed up your results query to have it give the instance names instead of just rows with MSSQLSERVER which...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 15, 2011 at 10:06 am
Ysaias Portes-483038, your solution implies he knows an instance he can log into...all he has are host names.
I agree with your comment about xp_cmdshell though...avoid it!
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 15, 2011 at 9:36 am
I feel your pain man...there is no official "standard" for CSV files...this is the closest thing out there but it's just an RFC: http://www.rfc-editor.org/rfc/rfc4180.txt
Your file conforms to section 2, unfortunately...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 15, 2011 at 7:30 am
Using EXECUTE AS is the approach I have used but only when using a database user with no associated server login as a proxy. This article from Erland should get...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 15, 2011 at 6:50 am
Using only T-SQL? Unfortunately there is no BULK EXPORT command to counter the BULK INSERT command. You're options are to call bcp using xp_cmdshell (yuck!) or move the process into...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 14, 2011 at 4:54 pm
Someone may correct me if they know of a better way in SSIS, but I think you're better off doing this work in T-SQL. Please read the article in my...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 14, 2011 at 3:41 pm
I ran into this same issue with SSIS but after lots of complaining amongst my team, having several experienced SSIS developers "take a shot" at the problem, as well as...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 14, 2011 at 3:35 pm
Please read this article, it explains it all: http://www.sqlservercentral.com/articles/Best+Practices/61537/%5B/url%5D
In addition to the DDL and DML please post the queries you have tried so far 🙂
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 14, 2011 at 3:27 pm
Oh well...that's not something bcp can do with built-in functionality. You would have to do something with UNION ALL in your query to make the first row of your resultset...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 14, 2011 at 2:41 pm
Jeff Moden (4/13/2011)
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 14, 2011 at 2:22 pm
Have you tried using bcp? bcp may prove to be faster than sqlcmd. bcp was designed to be fast at getting data from a file on disk into SQL Server,...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 14, 2011 at 1:28 pm
Jack Corbett (4/14/2011)
I've run the script in my environment (different query) and it has worked. I'm not sure what's happening in your environment.
Ditto.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 14, 2011 at 12:33 pm
Viewing 15 posts - 6,646 through 6,660 (of 7,164 total)