Viewing 15 posts - 91 through 105 (of 167 total)
Setup a Linked-Server via Enterprise Manager or with the system sprocs.
Then call the scalar UDF via OpenQuery as such:
Select * from OpenQuery(LnkSrv,'select dbname.dbo.udf(parms)')
or for table-valued UDF as such:
Select * from...
June 12, 2007 at 8:36 am
Try this:
-------------------------------------------------------------------
Declare @i Int,@Str VarChar(8000)
-- Setup test string with weird stuff in it.
Set @Str=Char(7)+'Line1'+Char(9)+'Line2'+Char(255)
Print @Str
Set @i=PatIndex('%[^'+Char(32)+'-'+char(126)+']%' collate Latin1_General_BIN,@Str)
While @i<>0 Select @Str=Replace(@Str,SubString(@Str,@i,1),' '),
@i=PatIndex('%[^'+Char(32)+'-'+char(126)+']%' collate Latin1_General_BIN,@Str)
Print @Str
-------------------------------------------------------------------
Create a UDF with something...
June 8, 2007 at 11:57 am
You can use Select Distinct ... or Group By in special cases where you don't care if things get aggregated...
June 1, 2007 at 8:47 am
To strictly answer you question you could:
Select distinct(MasterCodeID),Min(othercolum),max(anothercolum) ...
could be used to get something from the other non-distinct colums. You choose the aggregate function that suits your purposes.
May 15, 2007 at 9:42 am
Or, more generically,
like '%['+Char(0)+'-'+Char(31)+Char(127)+'-'+Char(255)+'!@#$%^&*()_+=-]%' Collate Latin1_General_BIN
March 21, 2007 at 12:44 pm
Change the : to a \ ...
March 1, 2007 at 8:16 am
If you've only got 4GB RAM I would only enable the /3GB boot config switch, and that if you don't mind loosing 1GB from the OS (increased paging if using...
February 13, 2007 at 9:18 am
... and once you get the OS lined up don't forget:
/PAE boot startup configuration option
and
"Lock Pages in Memory" in the Local Security Policy settings
as well as letting SQL Server know you...
February 13, 2007 at 8:47 am
Try:
RaisError() with NoWait
... and don't foget to escape any '%' in your output string...
February 12, 2007 at 8:47 am
Try this (using Pubs as a test...)!
Use Pubs
Exec sp_MSForEachTable
'Set NoCount On;
Declare @wc VarChar(8000);
Set @wc=''''
Select @wc=@wc+'' [''+[Name]+''] is Null or'' from dbo.syscolumns with (nolock) where [id]=object_id(''?'') and IsNullable=1;
If Len(@wc)>0 Begin
...
February 9, 2007 at 1:23 pm
As mentioned above sp_help will get you the SP's parameters but generically obtaining their values is another issue. DBCC InputBuffer(@@SPID) (also mention above) would get you the values of the...
February 9, 2007 at 8:37 am
Compare the connection properties of the two environments. One or more of the differences could be causing your problem...
January 8, 2007 at 9:54 am
select t1.* from t1
join t2
on ... and t1.HouseNumber=t2.HouseNumber and ('' in (t1.Flat,t2.Flat) or t1.Flat=t2.Flat)
December 19, 2006 at 8:36 am
dbcc checkident('tablename',reseed,<seednum>
November 22, 2006 at 11:23 am
Select ... into <new table> from <old table> where <rows to keep>
drop <old table>
sp_rename <new table>,<old table>
barring any "constraints"
November 13, 2006 at 10:06 am
Viewing 15 posts - 91 through 105 (of 167 total)