Viewing 15 posts - 1,921 through 1,935 (of 2,171 total)
declare @ids varchar(5)
SET @ids = '1,2'
declare @sql varchar(1000)
select @sql = 'SELECT SATA_AllocationObject.*, Id AS Expr1'
July 22, 2006 at 3:14 pm
Check out the MSDB database tables
Sysjobs
SysjobHistory
SysjobSchedules
SELECT * FROM msdb..sysjobs
SELECT * FROM msdb..sysjobhistory
SELECT * FROM msdb..sysjobschedules
July 21, 2006 at 8:46 am
select MyField,
stuff (
MyField,
8,
case
when charindex('&', MyField) = 0 THEN LEN(MyField)
ELSE charindex('&', MyField) - 8
end,
10 + case
when charindex('&',
July 21, 2006 at 6:39 am
Do you have sample data from your REAL table?
It seems to me that you do not have "VIEWID=" first in every row, if any text at all is present.
Run this...
July 21, 2006 at 2:45 am
Yes, they are equally safe.
The DATEDIFF(day, 0, GETDATE()) calculates the number of days passed since day Zero, which is January 1, 1900. This is what clips the time information.
These number...
July 21, 2006 at 2:41 am
No.
Just copy this code and paste to you Query Analyzer.
select MyField,
stuff (
MyField,
8,
case
when charindex('&', MyField) = 0 THEN LEN(MyField)
ELSE charindex('&', MyField)...
July 20, 2006 at 2:50 pm
That is just for simulating your environment. I am populating my table variable with test data.
-- Populate test data
declare @a table (z nvarchar(100))
insert @a
select 'VIEWID=582' union...
July 20, 2006 at 2:26 pm
declare @a table (z nvarchar(100))
insert @a
select 'VIEWID=582' union all
select 'VIEWID=582&PARAM1=A%25' union all
select NULL
select z,
stuff (
z,
8,
case
when charindex('&', z) = 0 THEN LEN(z)
ELSE charindex('&', z) - 8
...
July 20, 2006 at 2:15 pm
This might give you an idea how to start
-- Prepare test data
declare @customers table (custid int, custname varchar(2))
insert @customers
select 1, 'AA' union all
select 2, 'AB' union all
select 3, 'C' union all
select 4,...
July 20, 2006 at 4:45 am
As the error says, you are trying to change a column that has a foreign key constraint to another table.
July 20, 2006 at 4:11 am
Yes, R2ro's solution is fast. And if I change
SET @daysDiff = DATEDIFF(day, @prmLoDate, @prmHiDate)
to
SET @daysDiff = 1 + DATEDIFF(day, @prmLoDate, @prmHiDate)
it calculates the right days too.
I...
July 20, 2006 at 3:50 am
Good! Here is a guy who actually read the first part of the article where I wrote that a CROSS JOIN solution is the fastest solution