Viewing 13 posts - 1 through 13 (of 13 total)
If you have SQL 2005+ you can use a CTE to get the results:
DECLARE @StartDate DATETIME;
DECLARE @EndDate DATETIME;
SET @StartDate = '4/1/2012';
SET @EndDate = '6/15/2012';
;WITH
n AS (SELECT num...
July 16, 2012 at 6:17 pm
This is a very useful script. However, there is really no need to use a cursor here. The code can be simplified just by deleting rows which do...
August 7, 2010 at 10:50 am
This could also be done simply using the INFORMATION_SCHEMA.TABLE_CONSTRAINTS view.
SELECT 'EXEC sp_rename ''[' + c.CONSTRAINT_SCHEMA + '].[' + c.CONSTRAINT_NAME + ']'', ' +
'''PK_' + c.TABLE_NAME + ''',...
March 1, 2010 at 2:16 pm
I agree. Most vendors can easily switch translations, either EBCDIC or ASCII test as part of the FTP Upload process. But the issue of how to deal with...
January 14, 2010 at 10:51 pm
I edited the original post containing the fnUnpack function to fix the undeclared @i variable error (should be @pos). Please let me know if there are any other problems...
January 13, 2010 at 11:30 pm
As mentioned earlier in this thread, the @i variable is incorrect and should be @pos. I had changed the variable name for clarity's sake in the original post and...
January 13, 2010 at 11:20 pm
ava1over: Thanks for the posting that link. You are right, no need for 3rd party controls when you simply need a way to translate fields like we've been...
October 16, 2009 at 2:56 pm
That code was written so long ago, but by the looks of things, I probably changed the [font="Courier New"]@i[/font] variable to [font="Courier New"]@pos[/font] at the last minute to make the...
May 4, 2009 at 6:12 pm
I ended up taking a slightly different approach and created a stored procedure to call before creating a default constraint. The stored procedure is merely an IF EXISTS...DROP CONSTRAINT...
November 12, 2008 at 4:10 pm
Paulo,
Not sure about your question. Do you mean you want to convert data to packed decimal (as in export) or read in a data field as a decimal value?...
October 6, 2008 at 6:33 pm
One way you could do this (which I believe is also the fastest), is to use BULK INSERT into a staging table. First, create a staging table:
[font="Courier New"]
CREATE TABLE...
December 17, 2007 at 5:31 pm
You are absolutely right. Welcome back to the "dark ages" of programming...:(
December 17, 2007 at 1:54 pm
I have had to create this in the past, and came up with a simple technique that relies on a UDF to translate the field. The best approach requires...
December 17, 2007 at 1:33 pm
Viewing 13 posts - 1 through 13 (of 13 total)