Forum Replies Created

Viewing 15 posts - 6,601 through 6,615 (of 8,753 total)

  • RE: Are the posted questions getting worse?

    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

    😎

  • RE: Select specific info from XML field

    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...

  • RE: How to Store Tabular Data having () as column name Into XML

    debanjan.ray (11/9/2014)


    Hi Experts,

    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...

  • RE: Are the posted questions getting worse?

    Jeff Moden (11/9/2014)


    Steve, I have an idea. Set it up so that when I report a post as spam and I include a secret word in the report, have...

  • RE: View "design sql statement" and "script view as" - sql miss match - SQL 2008 R2 sp2

    Quick thought, what happens if you script the view (modify/script as ALTER) and run the script unchanged?

    😎

  • RE: Need help with Dynamic SQL

    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...

  • RE: easy wildcard question

    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...

  • RE: easy wildcard question

    Out of curiosity, why are you using dynamic sql, looking at this query, I cannot see the need for it?

    😎

  • RE: easy wildcard question

    tswalton (11/9/2014)


    Thanks for the reply. I actually found a really quick solution to the problem that I'm not sure is documented anywhere.

    I was trying this

    select * from tblDomains where (domain...

  • RE: easy wildcard question

    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

    ...

  • RE: variable char

    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

    ...

  • RE: Are the posted questions getting worse?

    Ed Wagner (11/8/2014)


    Something must have happened with the spam filter. In the Recent Posts...Posts Added Today, there were 3 actual posts across the 4 pages. All other posts...

  • RE: General approach BULK INSERT, SELECT INTO, RENAME

    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...

  • RE: Using ":" in and attribute name in an xml file

    imran 60091 (11/7/2014)


    I have a package that imports and transforms xml files provided by a third party vendor. This process has been failing since the vendor changed attribute names in...

  • RE: variable char

    Quick though, since you are already using sp_executesql, you should consider passing the parameter using the parameter string parameter of that procedure.

    😎

Viewing 15 posts - 6,601 through 6,615 (of 8,753 total)