Viewing 15 posts - 16 through 30 (of 77 total)
Something that often goes overlooked when using sp_executesql is explicitly using unicode strings. It is good to keep in mind the SQL and ParmDefinition parameters are of nvarchar datatype....
May 25, 2010 at 12:29 pm
Additionally you might try something like the following utilizing sqlcmd variables. It allows you to leave the query the same. You just need to add the variables to...
May 21, 2010 at 2:23 pm
Jeff Moden (5/16/2010)
May 19, 2010 at 12:09 pm
Cool stuff! I definitely learn a lot from Jeff's code. So thanks Jeff!
It might be nice to change this very slightly:
,
cteCharacters AS
( --=== This is just the...
May 13, 2010 at 12:11 pm
There is a lot of good info in the posts for this discussion which makes good sense. Some good ideas to add to the arsenal.
I have similarly set up...
May 6, 2010 at 1:49 pm
Borrowing from the previous example, an additional way to go might be to use sp_executesql instead of EXEC. Then use some parameters where possible, i.e. "where task_name = @dynTaskName"....
May 6, 2010 at 9:10 am
Atif Sheikh (4/20/2010)
Declare @vTab Table (machinename varchar(10),dateRec datetime,recID int)
Insert into @vTab
Select 'machine 1', '4/14/2010', 1 Union ALL
Select 'machine 1' ,'4/12/2010', 2 Union ALL
Select 'machine 2' ,'4/12/2010', 3 Union ALL
Select 'machine...
April 22, 2010 at 2:43 pm
Mauve (4/16/2010)
In the stored procedure:
DECLARE @ContextInfo varbinary(128);
SET @ContextInfo = CAST('usp_FooCopy' AS varbinary(128));
BEGIN;
SET CONTEXT_INFO @ContextInfo ; -- Set the CONTEXT_INFO...
UPDATE MyTable SET
...
April 16, 2010 at 10:54 am
You should try looking into "Mail Merge" for Word documents. This feature is probably what you want to employ to go about doing this kind of a thing.
April 2, 2010 at 11:38 am
Another alternative to consider is nested try/catch to allow you to specifically narrow to each query. Something like the following may be a template for what you can try:
BEGIN...
February 18, 2010 at 10:08 am
The sp_MSforeachdb can have the "replace character" changed to a users preference. By default it is a '?'. It is the second parameter in the call. By changing...
February 3, 2010 at 2:47 pm
A few years back I needed to search for data in some DBs I wasn't familiar with. So I created a quick and dirty script to do this. ...
January 25, 2010 at 1:49 pm
And here is a link to another way using OPENROWSET:
January 8, 2010 at 4:22 pm
sam.walker (2/14/2009)
-- convert to csv fixed widthset @fixedstr = dbo.fnCsvToFixedClr(@fcsvstr, @fixedlength)
Can you post the fnCsvToFixedClr code? I am curious as to how it may be implemented as well.
January 8, 2010 at 11:39 am
GSquared (12/18/2009)
Your version will raise a priority 16 error that will abort that batch, but it will then continue to run from the next GO statement, which can cause problems,...
December 18, 2009 at 8:02 am
Viewing 15 posts - 16 through 30 (of 77 total)