Viewing 15 posts - 361 through 375 (of 683 total)
Here's a 'not recommended' way:
--data
create table #tableA (a int, b VARCHAR(3), c VARCHAR(4))
insert #tableA
select 1, 'DD', '5' union all
select 1, 'DS', '6' union all
select...
July 10, 2006 at 5:37 am
As a nasty hack, you can use the approach below, but you're much better off sorting out the problem at source (i.e. where you create that ugly result set).
July 6, 2006 at 11:01 am
> Query Analyzer only outputs 256 characters
Not necessarily. Try changing the setting in 'Tools -> Options -> Results -> Maximum characters per column'. Maximum setting is 8192.
Maybe that will give you...
July 6, 2006 at 9:19 am
>> Books Online states that SMALLDATETIME is only accurate to the minute.
Yep. That's why they will often have the same value for callreceived. And why you can't then really tell which...
July 6, 2006 at 9:15 am
How do you identify the "most recent" call if they have the same value for callreceived?
Perhaps you would be better using datetime datatype, rather than smalldatetime?
You can use "top 1" (as...
July 6, 2006 at 5:51 am
Peso - Really?
You can use OPENROWSET to add 2 rows to the top of an Excel sheet which already has data in it and add the date there? Really?
(I hope you're...
July 5, 2006 at 10:14 am
To do exactly this, I think you need to use OLE Automation. You can read about that in BOL, or here:
http://www.databasejournal.com/features/mssql/article.php/1442201
I think Excel will need to be installed on your...
July 5, 2006 at 9:56 am
So the xls file already exists, and you want to add a couple of rows (rows 1 and 2, say) to it and put the date in row 1? And you...
July 5, 2006 at 8:56 am
This looks like a dynamic pivot table request, and I suggest you refer these articles:
http://www.sqlteam.com/item.asp?ItemID=2955
http://weblogs.sqlteam.com/jeffs/archive/2005/05/02/4842.aspx
July 5, 2006 at 8:43 am
Amit - that returns "Jul 5 2" for me.
fred - one of these will get the date in the format you need.
select convert(varchar, getdate(), 101) as created...
July 5, 2006 at 8:40 am
Or...
create table #output (name sysname, sysname, access bit)
exec sp_MSforeachdb @command1 =
'insert #output select ''?'', name, hasdbaccess from ?.dbo.sysusers where name in (''guest'', ''public'')'
select * from...
July 4, 2006 at 7:59 am
The other link I posted said: "Drop it in the too hard basket - I'm going to do it another way....". You might, therefore, both be out of luck!
I recall...
July 3, 2006 at 10:34 am
A simple tally table and a cross join will save you a while loop / repetitive coding / typing. Here's one quick implementation as an example...
July 3, 2006 at 9:45 am
Or maybe something like this?
--data
declare @t table (col1 varchar(1), col2 int, col3 int, col4 int, col5 int)
insert @t (col1, col2)
select 'A', 1
union all select 'B',...
July 3, 2006 at 8:29 am
Viewing 15 posts - 361 through 375 (of 683 total)