Viewing 15 posts - 346 through 360 (of 362 total)
/*
Two Things:
1. Exec ([dynamicSQL]) is not a "script stopping" error if it fails.
2. Adding "WHERE 1=2" causes the query plan to only return the result's "structure"
...
November 21, 2003 at 8:21 am
I do this same thing in me Full Backup scripts when my recovery model is "simple".
November 20, 2003 at 11:06 am
Here's a PROC I 've used to output <8K files.
Create Procedure SyExport8KBlobToTextFile_sp
(@Blob varchar(8000) = NULL
,@OutPutFile varchar(256) = NULL)
as
if @Blob + @OutPutFile is NULL begin
print ' *******...
November 20, 2003 at 8:42 am
Gil, if you more timely output in the results pain of QA, instead of using PRINT,
use
raiserror ('[Your text here]',0,1) With Nowait
or
raiserror (@YourCharVariableHere,0,1) With Nowait
November 20, 2003 at 8:36 am
Try
DECLARE @QuerySQL Varchar(200)
SET @QuerySQL = 'exec GetEORepsByRA ' + Convert(Varchar(10), @ID)
-- then
exec master.dbo.xp_sendmail
@recipients=@mail,
@message=@body,
@subject='E&O Coverage',
@width=175,
@query=@QuerySQL
Observation: Parameters of PROCs, or for that matter Functions, can not be...
November 19, 2003 at 9:58 am
Try
-- Generic example ...
If Object_ID('TempDB..#Temp') Is Not NULL Drop Table #Temp
select * Into #Temp from OpenRowset('SQLOLEDB',
'Server=(local);Trusted_Connection=yes',
'Exec Master.dbo.sp_help ')
Select * from #Temp
If Object_ID('TempDB..#Temp') Is...
November 19, 2003 at 6:53 am
SELECT sname
From Student
Join Attendance
On Student.Student# = Attendance.Student#
Join Course
On Course.Course# = Attendance.Course#
Where Course.cname = "advance database"
And Student.degreetype = "professional Pathway"
SELECT sname
From Student
Where Student.degreetype = "professional Pathway"
and Student.Student#...
November 18, 2003 at 1:49 pm
Try...
-- Not recommended to use in a loop, does take a little longer to execute
-- Generic example ...
select * from OpenRowset('SQLOLEDB',
'Server=(local);Trusted_Connection=yes',
'Exec Master.dbo.sp_help ')
-- Example with your call...
November 18, 2003 at 11:30 am
November 18, 2003 at 11:18 am
I do not know what your "flat file" looks like, but if it contains values for your PKCheck identity column, try
SET IDENTITY_INSERT TableName ON
If PKCheck data is...
November 17, 2003 at 2:01 pm
Remember to look at your
SET DATEFIRST and @@DATEFIRST. Do not assume
Sunday - Saturday weeks in SQL.
Also Try DateDiff(wk, ...
instead of DateDiff(day, ...) ... 7
November 17, 2003 at 1:26 pm
-- A utilitarian SP I wrote a wile back
-- Drop Procedure SyExport8KBlobToTextFile_sp
Create Procedure SyExport8KBlobToTextFile_sp
(@Blob varchar(8000) = NULL
,@OutPutFile varchar(256) = NULL)
as
if @Blob + @OutPutFile is NULL begin
print ' ******* Procedure SyExport8KBlobToTextFile_sp...
November 17, 2003 at 1:18 pm
Write a SQL script something like the following:
1. Import your "new" data into a #Temp table
Maybe even in a disposable "temp" database
2. Index the #Temp table...
November 17, 2003 at 1:11 pm
You can try to set your rowterminator to '"/n'. This way, SQL will "eat" the doublequote that starts each record after the 1st record. It might be cleaner in using...
November 17, 2003 at 12:57 pm
Looks like ISQLW parses the results and uses Char(1) as some kind of delimeter. I've seen this before, but as you say, this is only in "Grid" mode, not really...
November 17, 2003 at 12:49 pm
Viewing 15 posts - 346 through 360 (of 362 total)