Viewing 15 posts - 2,506 through 2,520 (of 13,462 total)
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'...
February 14, 2014 at 1:35 pm
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...
February 14, 2014 at 1:19 pm
sram24_mca (2/14/2014)
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...
February 14, 2014 at 5:56 am
YB1D (2/13/2014)
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...
February 13, 2014 at 1:34 pm
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...
February 13, 2014 at 9:13 am
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...
February 13, 2014 at 9:02 am
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...
February 13, 2014 at 6:19 am
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')...
February 12, 2014 at 10:59 am
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...
February 12, 2014 at 9:01 am
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...
February 12, 2014 at 8:26 am
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...
February 12, 2014 at 7:10 am
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...
February 12, 2014 at 6:33 am
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,...
February 12, 2014 at 6:21 am
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...
February 12, 2014 at 5:53 am
Evil Kraig F (2/11/2014)
SSMS. Open database, click on tables. Go to Object Explorer Details window on right. If you...
February 11, 2014 at 2:28 pm
Viewing 15 posts - 2,506 through 2,520 (of 13,462 total)