Viewing 15 posts - 4,246 through 4,260 (of 5,393 total)
I have worked for a sofware company focused on cross-platform ERP solutions and I think I can throw in my 2 cents.
Writing ANSI SQL is "per se" a pain, but...
-- Gianluca Sartori
May 24, 2010 at 6:59 am
GilaMonster (5/24/2010)
... the logical file name you have specified is not part of the database and you should use RESTORE FILELISTONLY ...
Sorry for echoing, Gail.
-- Gianluca Sartori
May 24, 2010 at 6:33 am
What do you get when you request the filelist (filelistonly)?
I suppose the suffix "_new" is not part of the logical filename.
-- Gianluca Sartori
May 24, 2010 at 6:31 am
Try this:
;WITH messages AS (
SELECT mobile_number,
mobile_opt_in,
Row_Num = ROW_NUMBER() OVER(PARTITION BY mobile_number ORDER BY CAST(mobile_opt_in AS datetime) DESC)
FROM tbl_Messages AS A
INNER JOIN tbl_Mobile AS B
ON A.SWID = B.SWID
)
SELECT...
-- Gianluca Sartori
May 24, 2010 at 3:48 am
Write it by hand. There's a good example in the article I suggested.
Another option is downloading and installing SSMS Tools Pack[/url] and use the "generate insert statements" feature.
-- Gianluca Sartori
May 24, 2010 at 3:38 am
Great. Now post some sample data and you're done.
Be sure to post it as INSERT statement upon the tables you just scripted.
See the article in my signature if you're in...
-- Gianluca Sartori
May 24, 2010 at 3:24 am
I'll be glad to help if you at least try to post some table script and sample data.
-- Gianluca Sartori
May 24, 2010 at 3:17 am
This is the best place to start from if syntax is your issue:
http://msdn.microsoft.com/en-us/library/ms186858.aspx
-- Gianluca Sartori
May 24, 2010 at 2:58 am
I would suggest using ROW_NUMBER:
CREATE TABLE #tbl_Messages (
phone_number varchar(50),
time_stamp datetime
)
;WITH messages AS (
SELECT phone_number,
time_stamp,
Row_Num = ROW_NUMBER() OVER(PARTITION BY phone_number ORDER BY time_stamp DESC)
FROM #tbl_Messages
)
SELECT phone_number
FROM messages
WHERE Row_Num...
-- Gianluca Sartori
May 24, 2010 at 2:55 am
josh shilling (5/21/2010)
Try flipping the(Field LIKE @Param OR @Param IS NULL)
To
(@Param IS NULL OR FIELD Like @Param)
See this post by Mark Cohen...
That page contains quite questionable statements. It's...
-- Gianluca Sartori
May 24, 2010 at 2:08 am
Andy in Pembs (5/21/2010)
A very insightful piece, Phil, struck a chord with me.
Now this may be a little off-topic but understanding what...
-- Gianluca Sartori
May 21, 2010 at 6:11 am
tigriswoods (5/20/2010)
-- Gianluca Sartori
May 20, 2010 at 9:54 am
jmerrill 28016 (5/20/2010)
(@parameter is null or column = @parameter)
it won't ever look at the column...
-- Gianluca Sartori
May 20, 2010 at 9:08 am
Brett Robson (5/20/2010)
-- Gianluca Sartori
May 20, 2010 at 2:02 am
Nils Gustav Stråbø (5/20/2010)
Atif Sheikh (5/20/2010)
Dynamic SQL is the last thing to do
Dymamic SQL is the only efficient way (in my knowledge) to solve the problem with multiple optional parameters....
-- Gianluca Sartori
May 20, 2010 at 1:29 am
Viewing 15 posts - 4,246 through 4,260 (of 5,393 total)