Viewing 15 posts - 5,596 through 5,610 (of 8,731 total)
It works perfectly fine, the problem is that you're using 2 characters and stripping just one. You need to change the third parameter from the STUFF function.
To get better and...
October 30, 2014 at 9:38 am
I'm leaving you with 3 options. The third might be the best, but you have to test them.
declare @CODE varchar(32);
declare @Work varchar(32);
SET @Work = 'CASUAL'
SET @CODE = 1000
--Option 1
SELECT *...
October 29, 2014 at 6:25 pm
This article explains what you need to do.
http://www.sqlservercentral.com/articles/comma+separated+list/71700/
Be sure to use it only for display and don't store the concatenation in the database.
Notes:
You can use CHAR(10) + CHAR(13) for...
October 29, 2014 at 3:31 pm
In this case, you can update the CTE without problems. You just need to add the column you're updating.
WITH cte AS (
SELECT ID, patientid,admissiondate, dischargedate, lastdischarge,
...
October 29, 2014 at 10:51 am
Maybe you're looking for something like this:
Select *
from @new n
WHERE invoice_id IN( SELECT i.invoice_id
...
October 29, 2014 at 9:25 am
You can use a table valued constructor to simplify it
select Username
, (select max(choice) from (VALUES(column1 ), (column2), (column3), (column4),
...
October 28, 2014 at 3:06 pm
Here's an option on how to do it.
CREATE TABLE Customer(
custid int,
firstname varchar(50),
lastname varchar(50),
zipcode varchar(10))
INSERT...
October 28, 2014 at 1:55 pm
That seems fine to me. An alternative could be:
Case when Server_Excluded <> 'Yes' and Aged30 > 0 Then 'Green'
when Server_Excluded <> 'Yes' and (Group= '' OR...
October 28, 2014 at 12:49 pm
Here are two options:
CREATE TABLE Fun_Test( Somepath nvarchar( 50 ));
INSERT INTO Fun_Test
VALUES
( 'C:\QA\Documents\pdf1' ),
( 'C:\QA\Documents\pdf2'...
October 28, 2014 at 11:24 am
Grant Fritchey (10/28/2014)
jeffgonzalez007 (10/28/2014)
October 28, 2014 at 11:03 am
Scott always tell me not to rely on date settings, but I keep doing it :-D. This is a different way to achieve it with a single script.
CREATE TABLE TestDates(
...
October 28, 2014 at 10:29 am
rot-717018 (11/3/2010)
BTW, changing the function to a TVF is not the best solution here as it is used all over the DB.
Then create a new one and test for differences....
October 28, 2014 at 9:22 am
David,
Note that this is a 2 year old thread. That said, your code can be improved to avoid errors if table or column names have spaces or other characters. You...
October 27, 2014 at 11:11 am
This is a possible option based on Scott's post. You might need to use additional validations and things can get really complex really quickly.
SELECT
TextID,
...
October 27, 2014 at 10:34 am
Take a look at this article. It shows what's happening and how to get an all-digits validation.
October 27, 2014 at 10:25 am
Viewing 15 posts - 5,596 through 5,610 (of 8,731 total)