Tag Info

New answers tagged

1

When one needs to do something more complex that is available in the syntax, it is often useful to 'stage' the data through a temp table: Perhaps: CREATE TEMPORARY TABLE tmp ( ... DEFAULT 'myfile' ... ); LOAD XML ...; INSERT INTO tab1 SELECT * FROM tmp; or: CREATE TEMPORARY TABLE tmp LIKE tab1; LOAD XML ...; UPDATE tmp SET DEFAULT = 'myfile'; INSERT ...


2

Use value() instead. The value() function returns a scalar value and takes two parameters. The first is the xpath expression and the second is the data type you want. @ExpensiveXML.value('(/EventFileTarget/File/@name)[1]', 'nvarchar(260)');


5

Three options come to mind. Use a while loop and modify one node at a time Shred the XML using nodes(), modify the values and then rebuild using for xml. Cast the XML to a string and use replace(). Whatever works best in your case depends on the shape of the XML and what kind of modification you need to do. If you add the table structures with sample ...


0

How would I extract the value of 0x9473FBCCBC01AFE from an XML query plan as a VARBINARY, rather than a VARCHAR? I faced something like that using HeidiSQL to query on CASD tables, and solved with fn_varbintohexstr(), like this: SELECT master.dbo.fn_varbintohexstr(table.hexfield) FROM table; With HeidiSQL, the value was wrong like ...


1

This also depends on what kind of records you want to be stored, whether it is semi-structured data that is best formed using XML, or plain key-value based records. SQL Server Express can store both kinds, but involves an additional install. However, to avoid extra installs, you can check out SQL Server Compact and SQLite, both of which are installed as a ...


0

100 records * 500 to 1000 rows = 50.000 to 100.000 Did you try to estimate the size of the xml file based on the data type of your 'entry'? If you want to go down the SQL Server road, you can use SQL Server Express. It can be embeded in you installation package. Technet: How to Embed SQL Server Express in an Application SQL Server Express: Local Data ...


0

It looks like you want to fill out the email templates using only the unique data for each recipient. If this is true then I would recommend option 3. I would have a recipient table that is not directly linked to the email, but is instead linked to the email via a join table. I would also put a FK on the recipient table to the email sender. Then I would ...



Top 50 recent answers are included