Viewing 15 posts - 2,041 through 2,055 (of 2,458 total)
elham_azizi_62 (11/11/2013)
...now i want to use cte instead of while and temp table?is it possible?if yes,how can i do this?
thanks
You can do this using a recursive CTE like so:
WITH...
-- Itzik Ben-Gan 2001
November 11, 2013 at 1:37 pm
I would also recommend: http://en.wikipedia.org/wiki/ACID.
-- Itzik Ben-Gan 2001
November 11, 2013 at 12:46 pm
I think this will get you what you need:
DECLARE @Result varchar(1000);
WITH x(xx) AS (select * from Xml_Export listing for xml auto ,elements ,ROOT('Listings'))
SELECT @Result='<?xml version="1.0" encoding="UTF-8" ?>'+xx
FROM x
--this will...
-- Itzik Ben-Gan 2001
November 11, 2013 at 12:30 pm
dwain.c (11/6/2013)
Alan.B (11/6/2013)
DECLARE @names varchar(max);
WITH names(n) AS
(
SELECT Name
FROM dbo.iNamesExcel$
FOR XML PATH('')
)
SELECT @names=CHAR(39)+LEFT(n,LEN(n)-1)+CHAR(39)
FROM names
Then, in your DSQL change your...
-- Itzik Ben-Gan 2001
November 11, 2013 at 12:18 pm
Almost there... This was the first draft and, though it is processing all your variables, I made a mistake(s) somewhere in my formulas; I had very limited time. The reason...
-- Itzik Ben-Gan 2001
November 7, 2013 at 6:25 pm
Eric Mamet (11/7/2013)
Yes, it is very interesting and intriguing but...
-- Itzik Ben-Gan 2001
November 7, 2013 at 11:41 am
I am pretty sure that you can turn that into an inline table valued function. It isn't something I can do quickly but I will take a shot at this...
-- Itzik Ben-Gan 2001
November 7, 2013 at 9:58 am
You could do something like this (I changed @name to @names):
DECLARE @names varchar(max);
WITH names(n) AS
(
SELECT Name
FROM dbo.iNamesExcel$
FOR XML PATH('')
)
SELECT @names=CHAR(39)+LEFT(n,LEN(n)-1)+CHAR(39)
FROM names
Then, in your DSQL change your and displayName...
-- Itzik Ben-Gan 2001
November 6, 2013 at 6:39 pm
I would add that you can also do it like this:
--sample data
SELECT * INTO #test
FROM (VALUES (1,'blah AAA'),(2,'bbb bbb bbb'),(3,'AAA ccc')) t(id,val);
SELECT * FROM #test;
WITH your_table AS
(
SELECT * FROM...
-- Itzik Ben-Gan 2001
November 6, 2013 at 5:23 pm
SQLSteve (11/6/2013)
Still stuck on a solution for this if anybody could assist
I'm short on time here but will help get you started. Nothing you are doing sounds too difficult using...
-- Itzik Ben-Gan 2001
November 6, 2013 at 2:59 pm
matt6749 (9/23/2013)
I have a website/database app with a text column that stores a user's bio where users are not allowed to embed their phone number (e.g. similar to a dating...
-- Itzik Ben-Gan 2001
November 5, 2013 at 10:55 pm
dwain.c (9/23/2013)
matt6749 (9/23/2013)
-- Itzik Ben-Gan 2001
November 5, 2013 at 10:29 pm
Thanks Dwain!
-- Itzik Ben-Gan 2001
November 5, 2013 at 9:00 pm
Solomon Rutzky (11/5/2013)
Alan.B (11/5/2013)
With your question about reasonableness, it's up to you. If performance wasn't an issue, why maintain two different functions? If it does matter, you can create a...
-- Itzik Ben-Gan 2001
November 5, 2013 at 5:19 pm
Thanks!
With your question about reasonableness, it's up to you. If performance wasn't an issue, why maintain two different functions? If it does matter, you can create a calculated column on...
-- Itzik Ben-Gan 2001
November 5, 2013 at 11:44 am
Viewing 15 posts - 2,041 through 2,055 (of 2,458 total)