Viewing 15 posts - 2,101 through 2,115 (of 2,462 total)
You can also use PatternSplitCM (note the link in my signature)....
declare @val varchar(8000)= '[{mark,peters,mr}{jane,fonda,mrs}{john,doo,mr}{james,bond,mr}]';
WITH x AS
(
SELECT ItemNumber, Item
FROM dbo.PatternSplitCM(REPLACE(REPLACE(@val,'[{',''),'}]',''),'%[}{]%')
WHERE Matched=0
)
SELECTROW_NUMBER() OVER (ORDER BY x.ItemNumber) AS Id,
MAX(CASE WHEN ps.ItemNumber=1 THEN...
-- Itzik Ben-Gan 2001
October 7, 2013 at 4:24 pm
LutzM (10/7/2013)
SELECT
TempXML1.Node1.value('(server/text())[1]', 'varchar(50)') AS [server],...
-- Itzik Ben-Gan 2001
October 7, 2013 at 12:35 pm
This is what you are looking for
EXEC sp_xml_preparedocument @dochandle OUTPUT, @xmldocument;
SELECT
server,
name,
start_time,
type,
log_name,
media_mount_date,
drive_name,
media_label,
media_guid,
media_overwrite_date,
media_append_date,
media_set_target
FROM OPENXML(@dochandle, 'joblog', 1)
WITH
(
server [varchar](20) 'header/server/text()',
name [varchar](300) 'header/name/text()',
start_time [varchar](100) 'header/start_time/text()',
type varchar(20) 'header/type/text()',
log_name...
-- Itzik Ben-Gan 2001
October 7, 2013 at 12:11 pm
You can include table names or derived tables in your from clause but not a non-static value. Dynamic SQL (using sp_executesql not EXEC) is the way to go for this.There...
-- Itzik Ben-Gan 2001
October 3, 2013 at 4:23 pm
No problem, good luck!
-- Itzik Ben-Gan 2001
October 3, 2013 at 9:36 am
What I want to know:
Is it possible to have the SSRS report contain links within the results of the report that can be passed back to a Webform so that...
-- Itzik Ben-Gan 2001
October 2, 2013 at 3:41 pm
Printed books -- 100%.
I read pdf's & ebooks on my phone & tablet but this is only when it would not be convenient to huff around a real book.
-- Itzik Ben-Gan 2001
October 2, 2013 at 3:02 pm
I have always done this manually because of the types of SSIS packages I have dealt with did not work well with the Visual Studio conversion wizard. That said, here's...
-- Itzik Ben-Gan 2001
October 2, 2013 at 2:21 pm
Steve Smith-163358 (10/2/2013)
The software we use often creates a lot of temporary tables that need to be deleted from time to time.
Depending on the usage, this can range from hundreds...
-- Itzik Ben-Gan 2001
October 2, 2013 at 12:28 pm
I would strongly encourage you to look at the article that Gail posted.
I currently have a database of 80[gb]. did a shrink log file to 1 mega byte.
For a database...
-- Itzik Ben-Gan 2001
October 2, 2013 at 10:11 am
erikd (9/30/2013)
-- Itzik Ben-Gan 2001
September 30, 2013 at 4:58 pm
This is what you are looking for.
DECLARE @x xml;
SELECT @x = P
FROM OPENROWSET (BULK '\\usd\SurveyComputing\Sample\SampleRepository\Visit_Survey_2013_08_16_07_21_43.XML', SINGLE_BLOB) AS FMG(P)
DECLARE @hdoc int
EXEC sp_xml_preparedocument @hdoc OUTPUT, @x
select *
from OPENXML (@hdoc, 'SURVEY_EXTRACT/VISIT_SURVEY',...
-- Itzik Ben-Gan 2001
September 30, 2013 at 12:43 pm
For what you are doing I think Sean's solution is the way to go. That said, you could run them in parallel in an SSIS package then have your proc...
-- Itzik Ben-Gan 2001
September 30, 2013 at 11:53 am
Taking what Keith said, you could re-write your query like this:
WITH cteSource(CN, U1)
AS (
SELECTr.CN, r.U1
FROM dbo.SSS AS s
INNER JOINdbo.STU AS t ON t.SN = s.SN
INNER JOINdbo.CRS AS...
-- Itzik Ben-Gan 2001
September 30, 2013 at 11:27 am
What Louis posted is the way to go; no DSQL needed for what you are doing. That said, to accomplish this with a temp table you would need to use...
-- Itzik Ben-Gan 2001
September 30, 2013 at 10:58 am
Viewing 15 posts - 2,101 through 2,115 (of 2,462 total)