Viewing 15 posts - 121 through 135 (of 167 total)
Try:
Exec sp_CmdShell 'Echo Text for Line 1 & Echo Text for Line 2'
The "&" is the Command-Shell command separator. Of course, you could redirect this output to a file as...
December 27, 2005 at 9:07 am
Run Microsoft's dependency checker (depends.exe, ya, I don't care for the name either...) against your DLL. You will also need to load the DLL's that your DLL references. You probably don't...
December 27, 2005 at 9:00 am
So much for conventional wisdom...
This may not be what you want, but, try something like this:
Declare @Str VarChar(8000)
Set @Str=''
Select @Str=@Str+','Col1+','+Col2+','+...+Char(13)+Char(10) from dbo.[YourTable] where ...
Print @Str
You get the idea...
December 27, 2005 at 8:52 am
Try this:
-- Construct test UId table.
If Object_Id('Test') is not Null Drop Table Test
Select 0[UId] into Test
-- Obtain the next UId.
Declare @i Int
Update Test Set @i=UId,UId=UId+1
-- or --
Update Test Set @i=UId=UId+1
Which...
September 27, 2005 at 8:37 am
I use to write Extended Stored Procedures to handle the stuff that SQL wasn't "comfortable" with but XSProc are difficult to manage (versioning, interface requirements, environemtal requirements, testing, documentation... ad...
September 20, 2005 at 8:25 am
Use xp_CmdShell and START a copy of OSQL to run a script...
September 19, 2005 at 2:32 pm
Ya, I use to use xp_FileExists, but, I figured there's less a chance of the Command Prompt stuff going away than xp_FileExists... but then, who ever would have thought that...
September 19, 2005 at 2:11 pm
Try this:
If Object_id('test') is not null Drop Table Test
Create Table Test(Id int,ParentId int,[Name] varchar(256))
Insert Test Values(1,Null,'A')
Insert Test Values(2,1,'B')
Insert Test Values(3,1,'C')
Insert Test Values(4,2,'BA')
select
Id,
Name+Case IsNull((select top 1 t2.ParentId from test t2 where...
September 16, 2005 at 11:17 am
Ya, I know... here's the code...
Declare @v1 int,@v2 varchar(256)
Set @v1=123
Select @v1=456,@v2='789'
September 16, 2005 at 10:57 am
Paste the following into QA and click the "Display Estimated Execution Plan" tool button. Hang you mouse cursor over each "Select Cost 0%" page-image and you'll see that the "set"...
September 16, 2005 at 10:56 am
Uuups, sorry, its another "DOS" hack sproc in our common library system... Here's the code:
If Object_Id('PathExists') is not Null Drop Function PathExists
Go
Create...
September 16, 2005 at 10:46 am
If you don't have an allergic reaction to xp_CmdShell you could...
Declare @rc Int
Exec @rc=master.dbo.xp_CmdShell 'If Exist "c:\boot.ini" (Exit 1) Else (Exit 0)',no_output
Select @rc[Return Code]
September 13, 2005 at 10:35 am
You a funny guy There is a practical limit to using this technique, I leave it up to you to make that call...
September 6, 2005 at 8:51 am
I hear ya... But, you write the code once... your run it a bazillion times.. having SQL use the proper indicies can cover for a little code bloat.
September 6, 2005 at 8:40 am
September 6, 2005 at 8:31 am
Viewing 15 posts - 121 through 135 (of 167 total)