Forum Replies Created

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

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

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Trigger Question

    Dugi's got you on the right track. use ISNULL to put in a default value, or raise an error before it gets to the trigger in the first place.

    as...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Delete all data from multiple tables

    ps (6/19/2009)


    you can write a query to delete all tables in a schema.

    Also wouldn't it be good to drop the database if you do not want tables to be there?

    Question...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: increment child records based on parent id

    your'e trying to use an identity() column in the wrong way; an identity should simply identify one row as unique, and should never repeat...what you want is basically a ranking...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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