Viewing 15 posts - 6,601 through 6,615 (of 8,753 total)
Stuart Davies (11/10/2014)
Sadly I'm not getting the same sort of luck all I've had is the attached
Some guys have all the luck.....:-D
😎
November 10, 2014 at 5:16 am
Quick note, this xml structure doesn't make things easier;-)
😎
Here is an example that should get you passed this hurdle
USE tempdb;
GO
SET NOCOUNT ON;
DECLARE @TXML XML = N'<Status><IdStatus>1</IdStatus>
<NomStatus>Status 1</NomStatus>
<IdStatus>2</IdStatus>
<NomStatus>Status 2</NomStatus>
<IdStatus>3</IdStatus>
<NomStatus>Status 3</NomStatus>
</Status>
<Process>
<IdProcess>1</IdProcess>
<NomProcess>Process...
November 10, 2014 at 4:30 am
debanjan.ray (11/9/2014)
We are storing changed data of tables into XML format for auditing purpose. The functionality is already achieved. We are using FOR XML Path clause to convert...
November 10, 2014 at 12:01 am
Jeff Moden (11/9/2014)
November 9, 2014 at 10:44 pm
Quick thought, what happens if you script the view (modify/script as ALTER) and run the script unchanged?
😎
November 9, 2014 at 10:32 pm
First a quick question, what are you trying to achieve with this?
😎
You can use the DATALENGTH function on any datatype, here is a quick example:
DECLARE @SQL_STR VARCHAR(MAX) = '
-- Returns...
November 9, 2014 at 10:14 pm
tswalton (11/9/2014)
I'm editing an existing application. The dynamic SQL exists already, I just needed to tweak it a bit.
Guessed it would be something along those lines, just hope you are...
November 9, 2014 at 12:07 pm
Out of curiosity, why are you using dynamic sql, looking at this query, I cannot see the need for it?
😎
November 9, 2014 at 10:17 am
tswalton (11/9/2014)
I was trying this
select * from tblDomains where (domain...
November 9, 2014 at 10:06 am
Quick suggestion, use the charindex or patindex functions
😎
USE tempdb;
GO
SET NOCOUNT ON;
DECLARE @URL VARCHAR(150) = 'mywebsite.co.uk/folder/page.html';
DECLARE @tblDomain TABLE
(
Domain_ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED
...
November 9, 2014 at 9:47 am
peter478 (11/8/2014)
can you give me an example?
Quick example, more info here sp_executesql (Transact-SQL)
😎
DECLARE @COL_NAME NVARCHAR(128) = N'service_id';
DECLARE @PARAM_STR NVARCHAR(255) = N'@COL_NAME NVARCHAR(128)';
DECLARE @SQL_STR NVARCHAR(MAX) = N'
SELECT
...
November 8, 2014 at 9:49 pm
Ed Wagner (11/8/2014)
November 8, 2014 at 1:17 pm
Quick thought, nothing wrong with the DROP/RENAME approach, just remember to re-create any foreign key constraint etc. if applicable. Another way of doing this is to switch partitions, normally quicker...
November 8, 2014 at 10:06 am
imran 60091 (11/7/2014)
November 8, 2014 at 4:56 am
Quick though, since you are already using sp_executesql, you should consider passing the parameter using the parameter string parameter of that procedure.
😎
November 8, 2014 at 4:38 am
Viewing 15 posts - 6,601 through 6,615 (of 8,753 total)