Forum Replies Created

Viewing 15 posts - 4,951 through 4,965 (of 13,460 total)

  • RE: IF EXISTS DROP INDEX ... IF NOT EXISTS CREATE INDEX

    obligatory compatibility nazi post:

    sysindexes should be replaced with sys.indexes, as it's going to be dropped in some future version.

    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 to rollback if no PK assigned

    @Erin my knee jerk reaction was to check if there was something in the extended events to do what you are asking, but i'm just not seeing anything;

    to me 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: Does SQL recover databases sequentially, or in parallel?

    they are recovered , sequentially, master database first.; but each database seems to get it's own spid to startup, and some spids finish before others spids created after it.

    if one...

    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 to rollback if no PK assigned

    also you can simply create a DML trace on the database and capture all that information as part of a couple of events i think;SQL:BatchCompleted and RPC:Completed is what...

    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 to rollback if no PK assigned

    Erin Ramsay (8/13/2012)


    Hey Lowell,

    Is there a way to set that DBCC inputbuffer code on the database level so that when ANY trigger fires you can get the schema name, table...

    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 to rollback if no PK assigned

    LOL John it's feedback like that, knowing I helped someone, that really makes my day!

    inside a DML trigger, it's a differnet technique, but you bet I have examples of that...

    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: A function that will return user input

    joshphillips7145 (8/13/2012)


    So the variable @SearchParam goes with the function?

    it could, yes; the requirements are still a bit vague;

    if this is just "how to create a function( not a stored procedure),...

    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: procedure

    well the error implies you used a four part naming convention to reference a table/stored proc/view.

    something like

    SELECT * FROM SGEXP01.DatabaseName.dbo.TableName.

    if SGEXP01 is a database name, then you have a...

    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: A function that will return user input

    Well lets think it through Josh;

    an end user is using some sort of search function, is that the idea?

    do you need to search all the columns in your table, or...

    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: XML PATH Concatenate Syntax

    guerillaunit (8/13/2012)


    Lowell, what exactly is a "tagname" in XML?

    just like html, a tag is just a descriptor that describes or names it's contents.

    only in a specific context might 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: XML PATH Concatenate Syntax

    if you were actually building xml strings, the value inside would be a tagname for the XML.

    SELECT

    name

    FROM sys.columns sc

    FOR XML PATH('ParentTag')

    One of the neat things...

    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: Default value gets changed

    if you are seeing it in the data values , it could be some process is sending a value for the column with the default; values inserted take precendence over...

    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: Default value gets changed

    i couldn't duplicate the behavior yet; the tables i scripted out get teh default value with all zeros, whether in the constraint definition, the scripting of the table or in...

    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 do you use a sub query in a join?

    it's going to look somethign like this: i wasn't sure ont eh join criteria: i was assuming the table ztb_IMP_Notifications has the same sales_order_number

    SELECT

    ztb_Carrier_Delivery_Metrics.Delivery,

    ztb_Carrier_Delivery_Metrics.Delivery_Item,

    ...

    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: much worse execution plan calling stored procedure vs. query window

    sounds a lot like parameter sniffing;

    are you able to modify the procedure?

    I'd bet that by adding option (OPTIMIZE FOR (@PayrollID1 UNKNOWN)) it would build better plans.

    ALTER PROCEDURE [dbo].[GetPersonalTaxesAccumulators_v2]

    ( @PayrollID1...

    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 - 4,951 through 4,965 (of 13,460 total)