Viewing 15 posts - 1 through 15 (of 362 total)
Thanks, hope it still works , and all can enjoy.
May 28, 2004 at 1:29 pm
Yes, you are correct in that a VIEW has to be a SELECT statement. I often think of a T-SQL script to do the work when "CREATE VIEW..." is not...
May 27, 2004 at 7:12 am
Thanks for the reply... In the mean time, I noticed that at least when I use "...for XML AUTO, Elements", the columns where all records in set have a NULL...
May 26, 2004 at 12:24 pm
Changing things can make a big difference....
Anyway, I noticed that you have an INNER JOIN on [dbo.tcorder] without an ON clause ??? This should give you an error ???? (same...
May 26, 2004 at 9:16 am
Only thing I might change is instead of
2
Use
Convert(BigInt, 2)
That will insure the POWER() result can be a BigInt. Perhaps even make the @nPosition a BigInt also ???. You...
May 26, 2004 at 6:57 am
You are doing string manipulation to get your results. this is fine for readability, but if you need to call these functions for many records in a result set, it...
May 25, 2004 at 1:51 pm
Ya, there may be ways around doing what you want, but all the things I can think of are a lot harder than writing a quick UDF search & replace...
May 25, 2004 at 12:44 pm
Ilmar, a couple of things... You may want to make sure all the integers are BIGINTs for dealing with bits accessed with big numbers.
And check out SQLServer Central Article at...
May 25, 2004 at 12:37 pm
nExpression1 = nExpression1 ^ Power( 2, nExpression2) -- clear Bit nExpression2
(Bitwise Exclusive OR)
May 25, 2004 at 12:24 pm
You might be little out-o-luck, as far as pursuing it with a UDF, since you can not have dynamic SQL code in a T-SQL UDF
May 25, 2004 at 12:19 pm
Here is a little snippet from some of my code... may help you get started...
Bulk Insert {TableName|ViewName} From '{FileName}'
With ( CODEPAGE = 'RAW',
DATAFILETYPE = 'char',
ROWTERMINATOR = '\n',
FIELDTERMINATOR =...
May 25, 2004 at 11:57 am
You can use T-SQL's CASE sturucture
SELECT CASE WHEN shipdate < getdate() THEN 'shipped' ELSE 'pending' END as status
May 25, 2004 at 11:52 am
Case When nExpression1 & Power( 2, (nExpression2 + 1)) = 0 then 0 else 1 end -- returns 1 bit set
nExpression1 = nExpression1 | Power( 2, (nExpression2 + 1)) --...
May 25, 2004 at 11:50 am
Personally I'd use a T-SQL with BULK INSERT.
As for "testing" the file, check out this function I posted a while back with help from this forum... http://www.sqlservercentral.com/scripts/contributions/1028.asp
May 25, 2004 at 11:31 am
How about something like....
UPDATE T1
SET T1.StatusID =
CASE WHEN T2.Code = 1 THEN 3
WHEN T2.Code = 2 THEN 8
WHEN T2.Code = 3 THEN 13
END
FROM table_1 T1
INNER...
May 25, 2004 at 11:27 am
Viewing 15 posts - 1 through 15 (of 362 total)