Forum Replies Created

Viewing 15 posts - 10,936 through 10,950 (of 13,462 total)

  • RE: Looking for simple example of connecting to a 2nd SQL 2005 server

    this might help too; sometimes you want an alias for the other server instead of it's real name:

    EXEC master.dbo.sp_addlinkedserver @server = N'MyLinkedServer',@srvproduct = N'', @datasrc = N'STORMSQL\SQL2005', @provider = N'SQLOLEDB';

    --...

  • RE: Looking for simple example of connecting to a 2nd SQL 2005 server

    hope this helps; here's a clean, simple example.

    on my network, from my local dev machine ,there is a named instance on another server that i can connect to via SSMS,...

  • RE: Not able to create sp

    you'll get much more out of this doing it yourself. there is more than one error in your code. Don't be afraid of making changes to it.

    Like almost all forums,...

  • RE: Using linked server (Access db)

    i think Carolyn's right; for reference, this is the exact syntax i use to connect to an access database; if the last command, sp_tables_ex works, you are set up correctly,...

  • RE: Not able to create sp

    kiranjanga2 (6/23/2009)


    error is below.

    (EXECUTE cannot be used as a source when inserting into a table variable.)

    there's your error. change your table variable to a temp table instead.

    looks like the lines...

  • RE: replace space ' ' from column

    the REPLACE command is what you want:

    SELECt Replace(columnname,' ','') As Columname from YourTable

    it might be hard to see, but the command is singlequote-space-singlequote for WHAT to replace, and is two...

  • RE: Forum best practice - quoting code

    Tom i don't think noncode is a valid descriptor; i think you need to use plain or text.

    i saved this from a post previously so i had the valid tags...

  • RE: converting lowercase to uppercase

    pradeep's suggestion for a trigger to uppercase the input would work, and you could force only the upper case values to be inserted with a slightly different constraint:

    Create table Patient...

  • RE: Sorting the tables according to foreign key constraint.

    lakshminarasimhanv (6/20/2009)


    hi Thanks for your repl

    Can you please tell me how to modify the script to delete records from master and check if any dependent child will be afftected....

  • RE: Sorting the tables according to foreign key constraint.

    that would be the easy part; since the temp table #Hierarchy has the tables in the right order, change the last SELECT statement to this:

    SELECT

    CASE WHEN FKLevel=0...

  • RE: Can not turn ENTITY_INSERT Table ON.

    you must explicitly identify the column names, especial when identity_insert is on:

    SET IDENTITY_INSERT MyTable ON

    insert into MyTable(ColumnId,ColumnDate) values(3508,'06/07/2009')

    zubamark (6/19/2009)


    Hi,

    I tried to execute in SQL Server 2005 Query Analyzer the following...

  • RE: Creating a Case Statement

    something like this should get you started:

    SELECT

    @Category As TheSelectedCategory,

    CASE

    WHEN ILCategory IN (3,4) AND SCCategory =1

    THEN...

  • RE: Delete all data from multiple tables

    here's a script that creates the delete/truncate commands for all tables in the correct foreign key hierarchy order....

    the issue I've always found is that often you have lookup tables, like...

  • RE: increment child records based on parent id

    Ok - but the problem is, sometimes the parent_id could change from another system. That's where I'm getting lost here. I'm trying to avoid using the parent_id as an identity....

  • RE: How to run a Trace File without Profiler??

    you wouldn't open a trace file directly with notepad.

    here's what i do:

    i create a view for any trace i create, so I can easily access it.

    here's a code example:

    --review all...

Viewing 15 posts - 10,936 through 10,950 (of 13,462 total)