Forum Replies Created

Viewing 15 posts - 2,506 through 2,520 (of 13,460 total)

  • RE: Help Select Query

    probably using FOR XML to concatenate the values is what you want.

    here's an example:

    declare @skills table (sys int, TeamId varchar(20))

    insert into @skills

    SELECT '100','Team-1' UNION ALL

    SELECT '100','Team-2' UNION ALL

    SELECT '100','Team-3'...

    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: USER PERMISSIONS/SECUIRTY ISSUE

    sounds like the user inherits a sysadmin permission due toi the windows groups the login belongs to.

    this will enumerate all users in windows groups, and then join them to see...

    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 auto refresh the existing job using stored procedure

    sram24_mca (2/14/2014)


    Hi,

    We have an stored procedure to create/execute the job automatically, now we are looking for auto refreshing the job if there is any problem[Data changes] while running...

    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 define a server role that can see all that a sysadmin can see but cannot alter anything?

    YB1D (2/13/2014)


    Hi,

    In SQL Server 2008 is there a way a user can view everything (all databases, all logins, storage, et al) at server level and each database level, while being...

    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: Size of database is growing very fast

    really? that is not what i'd be expecting.

    o you have a lot of tables that are HEAPS, that get a lot of updates? HEAP tables never release space unless...

    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: Size of database is growing very fast

    my first guess is that you have a runaway log file, because the database is set to full recovery, and you are not doing LOG backups.

    select

    recovery_model

    from...

    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: SQL Server Function: Cursor or Tally Table; which to use, HELP

    knives the fix is rediculously easy;

    the Tally table needs to start at zero instead of one.

    so this tiny subsection changes:

    TALLY (N) AS (SELECT ROW_NUMBER() OVER (ORDER BY (SELECT 0)) FROM...

    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 select a group of select columns in a conditional statement

    the isnull or coalesce functions can help there:

    coalesce lets you grab more than one alternative, and even finish with a default if all columns were null.

    SELECT

    ISNULL(Send_To_Address,Bill_To_Address) AS Bill_To_Address,

    COALESCE (Send_To_Address,Bill_To_Address,Mail_To_Address, 'Missing')...

    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: Execute large number of insert statements

    i've found that files that contain INSERT INTO ....statements are painfully slow in SSMS once they hit, say 40K rows or more, stretching simple inserts into minutes of waiting.

    i'd prefer...

    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 msdn wrong about trigger permissions?

    ownership chaining is what is happening, i'm pretty sure.

    i believe that in this case, because all the objects are owned by the same schema(dbo), it's the same logic that follows...

    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 number to words

    also be careful; I know this is a common homework question in some SQL classes in India, and you don't want to grab someone elses solution.

    you want to learn...

    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: Open Multiple SSMS from CMD using Run AS AND prompting for password once

    ok several dumb questions here:

    why do you need to do work via SSMS as different users? why not have a superuser do all the work?

    why cna you not simply use...

    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 reduce sorting cost?

    can you post the ACTUAL execution plan? there's gotta be a difference between estimated and actual to explain such a huge difference.

    the estimated plan thinks it will return one row,...

    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: extract a string from a stored proc definition

    I don't see any reason to use a cursor or lopp structure here;

    you can do it all in a single pass.

    since the proc definitions can be large, you'd want 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: Generating CREATE TABLE Scripts for a large number of tables

    Evil Kraig F (2/11/2014)


    That is one LONG way around the pond, Lowell.

    SSMS. Open database, click on tables. Go to Object Explorer Details window on right. If you...

    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 - 2,506 through 2,520 (of 13,460 total)