Viewing 15 posts - 18,466 through 18,480 (of 18,926 total)
I guess that my test case is wrong because when I run this :
set ansi_nulls off
Declare @FkParentOBJ as int
SET @FkParentOBJ = null
Select top 10 * from dbo.ObjSQL WHERE FkParentOBJ...
March 2, 2005 at 11:32 am
How's this for reverse engineering :
Select Object_name(id) as TableName, 'DROP STATISTICS [' + Object_name(id) +'].[' + name + ']' from dbo.SysIndexes where indid > 0 and indid 0...
March 2, 2005 at 11:22 am
It's not a table : run this in the master table
Select objectproperty(object_id('sysperfinfo'), 'TableIsFake')
It will return 1. This means than when you query that table, Sql server meterializes it so...
March 2, 2005 at 10:21 am
I'm curious to see what other people are gonna say but I think you'll have to run a second query to get the actual count. Or run the query...
March 2, 2005 at 9:21 am
BTW... I forgot to say that something like this is better handled at the client side of the app because it's really presentation stuff. I only HAD TO use...
March 2, 2005 at 8:56 am
That's why I love this site... so many simple solutions that make your life easier. Thanx for everyone's input (even if I didn't start the thread).
March 2, 2005 at 8:53 am
hmm ya... I'm used to return strings that end with ', '.. but even then LEN() would chop the last space.
To sum up the best approach in all...
March 2, 2005 at 8:51 am
Actually it might run faster like this :
Select A.PPID, dbo.fnItems(A.PPID) as Items from
(Select DISTINCT PPID FROM dbo.YourTable) A
ORDER BY A.PPID
March 2, 2005 at 8:11 am
CREATE FUNCTION [dbo].[fnItems] (@Id as int)
RETURNS varchar(500) AS
BEGIN
Declare @Items as varchar(500)
SET @Items = ''
Select @Items = @Items + CAST(acctnum as varchar(10)) + ',' + CAST([time]...
March 2, 2005 at 8:09 am
Personal preference: don't like to play with set options unless I have to... especially when someone else may be changing the sp later on.
I had considered PW's option of ISNULL(,...
March 2, 2005 at 7:58 am
For the global connection :
Open a module and declare the connection like so
Public MyCn as ADODB.Connection
'run this on the program startup
public sub AutoExec ()
set mycn = new adodb.connection
mycn.open "..."
end...
March 2, 2005 at 7:32 am
Disable
ALTER TABLE ObjSQL NOCHECK CONSTRAINT ALL
enable
ALTER TABLE ObjSQL CHECK CONSTRAINT ALL
March 1, 2005 at 3:00 pm
I still don't think it would work because null doesn't equal null so that part of the query wouldn't work...
how about :
where product_id is null and @ProductId is null...
March 1, 2005 at 2:53 pm
Create procedure dbo.MySP @UserId as int
as
--do something here
go
in asp net
Dim iUid as integer
iUid = mycookie.value
call the stored proc and set the @UserId parameter using iUid
March 1, 2005 at 2:03 pm
On which line are you getting this error (read is the error coming from sql server or asp net).
Can you post the strUser value before executing?
March 1, 2005 at 1:59 pm
Viewing 15 posts - 18,466 through 18,480 (of 18,926 total)