Viewing 15 posts - 4,951 through 4,965 (of 8,731 total)
A pattern splitter can help you with this and I hope that you can complete the solution.
Reference: http://www.sqlservercentral.com/articles/String+Manipulation/94365/
Select *
from #tbl_data
CROSS APPLY (SELECT TOP 1 Item
...
May 12, 2015 at 11:13 am
Keith Mescha (5/12/2015)
How about REPLACENULL( «expression», «expression» )
REPLACENULL() was introduced with SSIS 2012 and this is a 2005 forum. I still wonder why it took so long to include this...
May 12, 2015 at 10:54 am
I'm not sure how Alvin's query solved the problem as the LIKE operator will implicitly convert values into strings.
DECLARE @test-2 TABLE(
Numbers int)
INSERT INTO @test-2 VALUES(12),(75924),(75),(53756),(2354)
SELECT Numbers
...
May 12, 2015 at 10:23 am
I agree with Sean, formatting in the front end will help you with order and more format functions.
However, here's a shorter way to do it.
SELECT STUFF( CONVERT( char(11), GETDATE(), 0),...
May 12, 2015 at 10:14 am
nycdotnet (5/12/2015)
CELKO (5/11/2015)
Perhaps you would like to actually learn SQL before you post?Ouch! Nevermind.
Or you could continue to post more questions to learn more about SQL, even if...
May 12, 2015 at 8:45 am
Please provide DDL, sample data and expected results based on that sample data.
Check the following article to help you with the correct way to do it: http://spaghettidba.com/2015/04/24/how-to-post-a-t-sql-question-on-a-public-forum/
It's not an unbreakable...
May 11, 2015 at 12:55 pm
nycdotnet (5/11/2015)
May 11, 2015 at 12:50 pm
That's because you're executing the following in the dynamic code.
USE SomeDB;
CREATE PROCEDURE usp_Something
AS
...
As the error states, the CREATE (or ALTER) statement should be the first (and only) statement in a...
May 11, 2015 at 12:49 pm
The best option is to store your full order number in separate columns so you don't have to worry about dividing it later (it's easier to join for presentation than...
May 11, 2015 at 12:22 pm
What's not working? Why aren't you using parameters to execute sp_executesql? Why aren't you executing the dynamic code or at least printing it?
May 11, 2015 at 11:08 am
From what I understood, you don't need recursion or even a CTE. You're trying to unpivot your data to get an EVA model which might be a very bad idea...
May 10, 2015 at 5:05 pm
SQLRNNR (5/8/2015)
Lynn Pettis (5/8/2015)
Geez, now someone doesn't even understand that the code they are running generates and runs dynamic SQL.What is dynamic sql?
What is sql?
May 8, 2015 at 4:05 pm
Oracle NVL2() function would be great for this.
But since we don't have that functionality in SQL Server, IIF() presented by Phil or a classic CASE statement would do the job.
select...
May 7, 2015 at 11:32 am
Ed Wagner (5/7/2015)
Luis Cazares (5/7/2015)
Lynn Pettis (5/7/2015)
Catch the comment in this post: http://www.sqlservercentral.com/Forums/FindPost1683559.aspx
The problem is that this newborn isn't really a newborn, but keeps asking questions and making comments that...
May 7, 2015 at 11:26 am
Lynn Pettis (5/7/2015)
Catch the comment in this post: http://www.sqlservercentral.com/Forums/FindPost1683559.aspx
The problem is that this newborn isn't really a newborn, but keeps asking questions and making comments that show that he hasn't...
May 7, 2015 at 9:11 am
Viewing 15 posts - 4,951 through 4,965 (of 8,731 total)