Forum Replies Created

Viewing 15 posts - 11,131 through 11,145 (of 13,462 total)

  • RE: Selecting from a table where any column is named like 'ServiceNumber%'

    you probably want to change it to test for OR instead of AND...so it builds like this

    SELECT * from MyTable WHERE 1 = 2 --never happens

    OR ServiceNumber001Volume...

  • RE: Trigger for updating date ?

    your current trigger would update everything, where you really want to restrict it to the rows that were updated.

    inside a trigger, there are two virtual tables called INSERTED and DELETLED,...

  • RE: Selecting from a table where any column is named like 'ServiceNumber%'

    you'd have to use dynamic sql to build the sql; here's a working example:

    Create Table MyTable(

    Id int,

    Name varchar,

    Address varchar,

    ServiceNumber001Volume int,

    ServiceNumber002Volume int,

    ServiceNumber003Volume int )

    declare @sql ...

  • RE: Thank you very much for you reply, I appreciate it

    your welcome pav; settings like that are not always intuitive.

    for others reading this, pav was referring to how to export from Query Analyzer with a custom pipe character; the thread...

  • RE: Results to File using | (Vertical bar) by default as a column separator

    the format has nothing to do with the server you are connecting to...it's a setting for Query Analyzer.

    just change your export format here:

  • RE: Set default value for a column in INSERT trigger

    you could still add a default constraint later...but that's beside the point.

    you are right, you might need to do something in a trigger that is not quite doable in a...

  • RE: Set default value for a column in INSERT trigger

    I think you are a bit confused on default and timestamps.

    the "timestamp" datatype is poorly named, and should be referenced by it's synonym called rowversion is a special datatype...

  • RE: Basic SQL query for update

    Customer_Tags

    ------------------------------------------------------------------------

    CustomerID (int AutoNumber FK), TagId (int AutoNumber FK), Count (int)

    ------------------------------------------------------------------------

    i read his requirement as being that the Customer_Tags table was a many-to-many table with CustomerId , with FK's to other...

  • RE: converting .pdf and .doc files into binary

    don't forget the document name so you can restore it back from the image!

    create table #ORStable (docname varchar(255), doclen bigint, doc varbinary(max))

  • RE: Find and replace in a table column

    Find and Replace for TEXT/NTEXT fields is a pain.

    you have to be careful, of course, because the string you replace might be part of a larger string inside your article.

    I...

  • RE: Scripting a profile trace with CHANGEABLE file name

    Ive got a stored procedure which does it; is this what you want?

    --we want the current trace folder

    declare @path nvarchar(256)

    --ie c:\Program Files\Microsoft SQL...

  • RE: Basic SQL query for update

    yasser.azeem (5/7/2009)


    hi ,

    i have two tables , Tags and Customer_Tags

    Tags

    ---------------------------------------------------

    TagID (int AutoNumber PK) , TagName (varchar (50)

    ---------------------------------------------------

    Customer_Tags

    ------------------------------------------------------------------------

    CustomerID (int AutoNumber FK), TagId (int AutoNumber FK), Count (int)

    ------------------------------------------------------------------------

    i want to create an...

  • RE: Invalid use of a side-effecting operator 'INSERT EXEC' within a function:

    why can't you use a stored procedure instead of a function to get the data that you want?

    you could execute a stored procedure and insert into your temp table, then...

  • RE: SQL Trigger

    it was quick just because I've already got an write-to-file example in my code snippets; i knew that worked, it was just calling it in a trigger instead of a...

  • RE: SQL Trigger

    ok the below works; someone else may have other ideas.

    basically there is a function which calls SPOaCreate to make a file system object, to write/append to a file. that means...

Viewing 15 posts - 11,131 through 11,145 (of 13,462 total)