Viewing 15 posts - 106 through 120 (of 167 total)
You may have a DIRCMD environment variable set in one or both accounts using CMD.exe
Check the account SQL Server is running under and also the account you are logged on...
November 6, 2006 at 9:30 am
Parse the string into a temp table and do a:
Select count(*) from dbo.#tmp group by ValueColumn having count(*)>1
November 6, 2006 at 9:20 am
...and if any of your variables can be populated by user data you should take steps to prevent potential career altering SQL injections...
October 10, 2006 at 8:19 am
Hmmm,
That's disconcerting... I've tryed those two queries on 5 different servers (SQL2K SP3 on W2K Pro and 2003 Server) in-house and got the same wrong results each time. The only way...
September 27, 2006 at 3:57 pm
Loner,
Sorry, my bad I should have said fully-qualified remote table name instead of Linked Server table name
September 27, 2006 at 3:49 pm
I think you may have hit upon Microsofts buried disclaimer for this seemingly non-intuitive result...
My solution was to use OpenQuery() as you have mentioned,...
September 27, 2006 at 8:23 am
All of the above are good suggestion. I would add to that:
Check the connection default settings; compare them with the QA connection settings.
June 29, 2006 at 8:24 am
Declare a cursor variable. Pass the cursor variable as OUTPUT into sp_ExecuteSQL. The dynamic SQL should assign the cursor variable via SET and OPEN it before the batch completes.
May 4, 2006 at 8:49 am
Or...
Exec('Use targetdbname Drop Table tablename')
May 4, 2006 at 8:42 am
Use this function in a computed column that takes an Identity column as its input:
Create Function dbo.WeirdIdentity
(
@Num BigInt
)
Returns VarChar(256)
As Begin
Declare
@Digits Char(36),
@Results Char(17),
@i Int,
@j-2 Int
Set...
April 26, 2006 at 8:50 am
I use this quick and dirty function (emphasis on adjectives) for integer and decimal values. You must convert the number to a string format before calling this function (although it...
March 15, 2006 at 9:08 am
Try this:
In TSQL split the path from the executable; @Path & @Exe
Create a command string and execute it:
Set @Cmd='CD /D '+@Path+' & "'+@Exe+'" '"+@Parm1+"' '"+@Parm2+'" ...'
(notice...
February 20, 2006 at 8:52 am
Try:
Exec('your sql command')
If @@Error<>0 do something...
Exec('your sql command')
If @@Error<>0 do something...
Exec('your sql command')
If @@Error<>0 do something...
With this method individual SQL command failures will not stop the entire batch.
January 11, 2006 at 9:04 am
Huh? You should get an error stating that @i does not exist in the batch context...
Try:
Declare @sql nVarChar(4000)
Set @sql=N'Declare @i Char(1) Set @i=''a'' Select *,@i from dbo.sysindexes'
Exec sp_ExecuteSQL @sql
January 10, 2006 at 8:25 am
Try something like this...
Declare
@Dir VarChar(1024),
@Cmd VarChar(8000)
Select
@Dir='C:\WinNT',
@Cmd='Dir /A-D /B "'+@Dir+'"'
If Object_Id('tempdb.dbo.#tmp') is not Null Drop Table dbo.#Tmp
Exec
(
'Create Table dbo.#Tmp(Dir VarChar(1024) default '''+@Dir+''',FN VarChar(256))
Insert dbo.#Tmp (FN)
Exec...
December 27, 2005 at 9:37 am
Viewing 15 posts - 106 through 120 (of 167 total)