Viewing 15 posts - 31 through 45 (of 424 total)
suggestion: insert a row of default values and then update that row with the passed values.
create table #test ( k int identity(1,1), a int default 22, b varchar(99) default 'missing',
...
December 8, 2008 at 6:31 pm
use sqlcmd and a command file (batch file):
sqlcmd -S myserver -d dbname -U user -P password -i file1.sql -o file1.log
sqlcmd -S myserver -d dbname -U user -P password...
December 8, 2008 at 3:09 pm
this link may help you:
http://forums.microsoft.com/msdn/showpost.aspx?postid=377410&siteid=1
December 8, 2008 at 9:11 am
you'd have to create your own gui component for collecting those parameters. if you just use SSRS' automatically generated entry panel, all parameters will be displayed.
December 8, 2008 at 9:06 am
report parameters are global, so just reference it in the other dataset.
December 8, 2008 at 9:03 am
add another dataset based on the sql you already mentioned. then reference the first row and last row of that dataset in your expressions (if sorted by gender, Females...
December 5, 2008 at 2:25 pm
Ninja's_RGR'us (12/5/2008)
half the time, the -1 value shows up, and the other half I get a...
December 5, 2008 at 2:22 pm
ISNULL(a.DEClearedDate, b.SomaticClearedDate, c.PsycClearedDate) AS ClearedDate
isnull can only accept 2 parameters. you can use coalesce() or multiple isnull()s.
COALESCE(a.DEClearedDate, b.SomaticClearedDate, c.PsycClearedDate) AS ClearedDate
ISNULL(a.DEClearedDate, ISNULL(b.SomaticClearedDate, c.PsycClearedDate)) AS ClearedDate
December 5, 2008 at 1:23 pm
Lowell:
I use the function below (created in our global db):
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create function [dbo].[fGetDayInWeek]( @date smalldatetime, @dayOfWeek tinyint )
returns smalldatetime
as begin
return dateadd( day, @dayOfWeek -...
December 5, 2008 at 11:26 am
josephptran2002:
You can use "WITH ROLLUP" to produce the total line. Look it up in the SQL documentation.
WITH CTE AS
( SELECT ISNULL(a.DECleared, 0) + ISNULL(b.SomaticCleared,...
December 5, 2008 at 11:10 am
Tom,
I kept fiddling with this and came up the following:
declare @bin_data table (category int, data varbinary(8))
insert @bin_data (category, data)
SELECT 1, CAST(0x2142434445464748 AS VARBINARY(8) )
union SELECT 1, CAST(0x3162636465666768 AS VARBINARY(8))...
December 5, 2008 at 10:59 am
the CASE function can only be used to return a value. it can't be used to limit WHERE clause comparisons. also, you can't declare variables within a sql...
December 4, 2008 at 10:09 am
you said your example was a simplication, but why can't you just use the + operator?
select CAST(0x4142434445464748 AS VARBINARY(8) )
+ CAST(0x6162636465666768 AS VARBINARY(8)) as result
result: 0x41424344454647486162636465666768
using xml to...
December 4, 2008 at 9:45 am
SELECT a_id FROM dbo.a WHERE a_id IN (SELECT a_id FROM dbo.b)
In the above statement, the table dbo.a and thus the column a_id is in scope and accessible in the sub-query....
December 4, 2008 at 9:01 am
select D1.DriveLetter,
sum(D1.FreeMB) as free_mb_start, sum(D2.FreeMB) as free_mb_end,
(sum(D2.FreeMB) / sum(D1.FreeMB) * 100) - 1 as percent_change
from dbo.vw_DriveSpaceHistory as D1
join dbo.vw_DriveSpaceHistory as D2
on D1.DriveLetter = D2.DriveLetter
where D1.DTStamp =...
December 4, 2008 at 8:56 am
Viewing 15 posts - 31 through 45 (of 424 total)