Forum Replies Created

Viewing 15 posts - 10,711 through 10,725 (of 13,460 total)

  • RE: SQL Dependency problem

    getting the objects in dependancy order is pretty easy;

    here is an example:

    CREATE TABLE #MyObjectHierarchy

    (

    HID int identity(1,1) not null primary key,

    ...

    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: Is there a way to programatically alter a function

    it depends on what you are doing Dean;

    offhand, if it was a simple find and replace, you could do something like this:

    declare

    @sql varchar(max)

    declare c1 cursor for

    SELECT ROUTINE_DEFINITION...

    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: Enabling Trigger when specific user will logOn..How?

    i was going to suggest teh same thing Paul suggested...forget trying to enable/disable a trigger, simple put an IF statment to check for that specific user;

    here's a handy script to...

    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: Using alter command in Stored Procedure

    i assumed this was pseudocode and he was using a temp table in the procedure;if it's a real table, Madhivanan is right , you'll have concurrency issues.

    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: Using alter command in Stored Procedure

    you need to either built your table with all it's columns, or use the EXEC(@sqlstatement) to do the alter an iupdate.

    the database engine expects either a GO statement, so it...

    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: Script to generate create table ddl

    I was stubborn and decided i had to do this the hard way via T-SQL;

    take a look at my script contributions here:

    Get DDL for Any SQL 2000 Table

    Get DDL for...

    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: Script to Reformat Results to Display Horizontally

    here's an example which uses the FORXML to produce a comma delimited list as a result for each ID:

    is this what you were after:

    Resource_Id    Skills
      ...

    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: Convert RTF data

    tom.goehring (7/29/2009)


    Lowell

    Did you ever get a chance to create the procedure for the steps below:

    3) Install IIS (please include with what pieces to install and configure)

    4) How do I create...

    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: Loading Trace Files To A Table

    there is a script submission that loads all the trace files into a table here:

    Default Trace Load of All 5 Files[/url]

    you could easily change the command from '*.trc" to logins*.trc"...

    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 Rename a Field in SQL Server 2008 by script ?

    nope, no other way. even the GUI does that behind the scenes...the ALTER TABLE clause only lets you changing some of the other attrivutes for column, like ISNULL,...

    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 Rename a Field in SQL Server 2008 by script ?

    what you want is the sp_rename function.

    with that, you can rename any object...table, constraint,column...doesn't matter.

    to rename a column, the syntax is like this:

    EXEC sp_rename 'SchemaName.TableName.ColumnName', 'NewColumnName, 'COLUMN';

    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: Linked and intermittently available linked server inside IF clause

    how about wrap it with try catch, and use dynamic SQL instead; that way it won't test for the connection until the EXEC fires:

    BEGIN TRY

    Begin Transaction

    IF @p_LoadExcelB = 1

    BEGIN

    SET @sql='

    INSERT...

    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: Using like in a set-based manner

    ok, i know that the moment you use a function on a JOIN or WHERE condition, you lose the ability to use indexes, and it requires a table scan.

    Your #1...

    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: Loading Trace Files To A Table

    why not create a view, so it is always ready on demand?

    CREATE VIEW MyTrace As

    Select * from FROM ::fn_trace_gettable(c:\my_trace.trc", default)

    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: T-sql search condition

    probably a misstatment, but you can't use a trigger i think, but you can certainly use a script to test for your invalid columns:

    here's an example of the first 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!

Viewing 15 posts - 10,711 through 10,725 (of 13,460 total)