Forum Replies Created

Viewing 15 posts - 841 through 855 (of 1,479 total)

  • RE: Querying XML Column

    select itemid,

    tbl.col.value('(.)[1]','int')

    from Test1 cross apply SerialNumbers.nodes ('/SERIALNUMBERS/SERIALNUMBER') tbl (col)

    If what you need is to get the ItemID of a known serial number, you can use the exists method:

    select...

  • RE: INSERT statement to add to list; DDL included

    If I understood correctly your requirement, this is one way of doing so. I did 2 joins to table #products. The first one is to get the product’s...

  • RE: bcp and literals

    thombaugh (8/30/2009)


    Hi all,

    I'm trying to use bcp to export results of a query, the problem is the database uses a column named 'transaction' which of course Sql Server doesn't...

  • RE: Grouping Question

    Christopher Gordon (8/28/2009)


    declare @myTable table(store int, product char(1))

    insert into @myTable

    (

    store

    ,product

    )

    select 1 ,'A' union

    select 1 ...

  • RE: Query Help

    Assuming that by total you ment the sum of the amt_1 columns, you can do it with the combination of sum and case statement. Here is an example...

  • RE: Group by

    It looks as if you don’t understand what group by clause does. Can you explain what are trying to do? There is a good chance that you can...

  • RE: Error "Nested INSERT INTO ... EXECUTE"

    I think that you can use the return value of xp_cmdshell. If it is 0, then it was successful. If it returns 1, then an error occurred. ...

  • RE: decrypt sql server 2005 sp

    I have to admit that I never understood why anyone would use the option to encrypt the procedure’s or view’s code. If you want to decrypt it, you...

  • RE: Beginning transaction in sql server 2008

    If you’ll check the value of @@trancount, you’ll see that it is 1. Also if you’ll run a statement that modifies any data in the transaction before you run...

  • RE: how to uninstall the server without affecting the named instance

    I don’t see why not. The named instance doesn’t depend on the default instance. Just go to Add/Remove programs and select the default instance.

    Adi

  • RE: When is statistics updated?

    According to the article at http://technet.microsoft.com/en-us/library/cc966419.aspx#XSLTsection130121120120 when one of the conditions is met, it marks the statistics as out of date:

    1) The table size has gone from 0...

  • RE: Searching From Varbinary Data Type

    Can you explain why you are using varbinary column to store plain text?

    In any case here is a small demo that shows you what to do in case that the...

  • RE: How to find out the columns of a PK with TSQL query?

    Another way is to use the information_schema.table_constraints view. Here is an example:

    select *

    from INFORMATION_SCHEMA.TABLE_CONSTRAINTS

    where CONSTRAINT_TYPE = 'PRIMARY KEY' and TABLE_NAME = 'WriteTableNameHere'

    Adi

  • RE: Importing XML from a file.

    I would still try the import with the openrowset function. Make sure that the account that is used by the SQL Server agent has permissions to read data on...

  • RE: how to data from xml file

    I think that you got the wrong forum. The forum is T-SQL and you are asking about .Net code. Also notice that the post didn’t go that well....

Viewing 15 posts - 841 through 855 (of 1,479 total)