Viewing 15 posts - 10,096 through 10,110 (of 14,953 total)
Jeff Moden (4/7/2009)
The 2nd question has nothing to do with SQL, either. It's about a "tabular file".
Though you could certainly accomplish the desired end-result through T-SQL. Either import...
April 7, 2009 at 11:07 am
donato1026 (4/7/2009)
I wish there was a tool out there that analyzed your queries and syntax and made suggestions on how to improve upon it.
This page and others like it are...
April 7, 2009 at 11:02 am
Flo: Yep. That's why I use that one. Easy to modify for other uses besides just removing time.
April 7, 2009 at 11:00 am
I just ran tests on this:
set nocount on;
if object_id(N'tempdb..#T') is not null
drop table #T;
create table #T (
ID int identity primary key,
Date datetime,
CleanedDate datetime);
insert into #T (Date)
select top 1000000 dateadd(second, checksum(newid()),...
April 7, 2009 at 10:04 am
The speed tests I've done have found that "dateadd(day, datediff(day, 0, @Date), 0)" has been the fastest.
The way to test it is to create a table with a million or...
April 7, 2009 at 9:53 am
donato1026 (4/7/2009)
April 7, 2009 at 9:50 am
Try this:
ALTER PROCEDURE [dbo].[GetDiscount1]
@Username VARCHAR(255)
@ret int output
AS
SET @ret = (
SELECT Discount.DiscountAmount
FROM Discount
WHERE DiscountCode = dbo.GetUserIdFromUsername(@Username)
)
You don't use "declare" in parameters. You need to include "output" after the parameter you want...
April 7, 2009 at 9:46 am
create table #T (
ID int identity primary key,
XMLCol XML);
insert into #T (XMLCol)
select ' ';
insert into #T (XMLCol)
select '';
insert into #T
default values;
select *
from #T
where XMLCol is not null and cast(XMLCol as...
April 7, 2009 at 9:39 am
Yes. This is what's called an "Inline Table Value Function". The prior version was a "Multi-Select Table Value Function". Both are types of "User Defined Functions".
The difference...
April 7, 2009 at 9:32 am
This will give you a list of the databases that have that table:
declare @sql nvarchar(max);
select @sql = coalesce(
@sql + ' union all select ''' + name + ''' as db...
April 7, 2009 at 9:24 am
I don't believe it's possible to do Select Into across servers.
April 7, 2009 at 9:13 am
Why would you do a cross join between those two? So far as I can tell, all the joins in the original query had the same two columns in...
April 7, 2009 at 9:11 am
Viewing 15 posts - 10,096 through 10,110 (of 14,953 total)