Viewing 15 posts - 3,916 through 3,930 (of 8,731 total)
I'm not at my computer right now, but you should check sp_executesql to use parameters with dynamic sql
November 3, 2015 at 12:17 pm
vamsi.341 (11/3/2015)
If you see the storedprocedure parameters, i am passing the USER as a parameter to the storedprocedure..
I tried using cursor instead of SP_MSForeachDB, same issue it's not accepting...
November 3, 2015 at 10:36 am
Of course it's not accepting the variable as you don't send it as a parameter, nor you declare it inside your dynamic code.
My suggestion is to avoid the undocumented procedure...
November 2, 2015 at 2:50 pm
Why are you doing additional work?
set nocount on
DECLARE
@AlterAuthorizationStatement nvarchar(MAX) = N''
, @db_user nvarchar(10)
set @db_user='test'
SELECT @AlterAuthorizationStatement = @AlterAuthorizationStatement + N'ALTER AUTHORIZATION ON SCHEMA::'...
November 2, 2015 at 2:14 pm
I've never used SQL Nexus before, so I can't help, but I just wanted to suggest to post your issue on the discussions for that tool. https://sqlnexus.codeplex.com/discussions
I hope that you...
November 2, 2015 at 12:17 pm
You should also use QUOTENAME( @fieldName) which would fix any problems causing SQL Injection. Or you could also validate its value against system views.
-- Your Parameters
DECLARE @fieldName varchar(128),
...
November 2, 2015 at 11:44 am
Eirikur Eiriksson (11/2/2015)
Lynn Pettis (11/2/2015)
SQLRNNR (10/31/2015)
For thread posterity:
It was awesome to get to meet some of the denizens of The Thread last week. Too bad Jeff Moden wasn't able...
November 2, 2015 at 10:28 am
SQL Server doesn't use the syntax CREATE TABLE...AS... Instead, it uses SELECT...INTO...
This should be what you're looking for.
SELECT mecase.CASETYPE AS [Case#],
mecase.mannerappears AS [Appearstobe],
...
November 2, 2015 at 9:27 am
TomThomson (11/2/2015)
November 2, 2015 at 8:05 am
Probably something like this:
DECLARE @cmd varchar(8000),
@protectType varchar( 6),
@action varchar(8000),
@object varchar(128) = 'sysdbfrag',
@grantee varchar(128);
IF @protectType...
October 30, 2015 at 1:57 pm
It makes sense to generate reports that show data per date. It won't make sense to generate additional data that will be simply duplicating rows.
Here's an example I did playing...
October 30, 2015 at 12:43 pm
It's possible by using a calendar table, but it doesn't make sense to duplicate rows when you're not adding anything special. Why do you want to have 3 ranges instead...
October 30, 2015 at 11:57 am
I'm not sure what you mean. What would be the problem?
INSERT INTO #TempTable(StringColumn) VALUES( @StringVariable);
--OR
INSERT INTO #TempTable(StringColumn) SELECT @StringVariable;
October 30, 2015 at 10:21 am
Jason A. Long (10/30/2015)
Luis Cazares (10/30/2015)
Ian Scarlett (10/30/2015)
I believe that most theorists would prefer blank spaces instead of null values.
Really? I understand the grief nulls can cause, but...
October 30, 2015 at 8:47 am
Meatloaf (10/30/2015)
Is there a way to make all data appear in one column so I would have a row like this:A,B,C,D,E,F,G, A_InMin,A_InMax,B_InMin,B_InMax,C_InMin,C_InMax,D_InMin,D_InMax,E_InMin,E_InMax,F_InMin,F_InMax,G_InMin,G_InMax,
Do you mean one column or one row?
For one...
October 30, 2015 at 8:37 am
Viewing 15 posts - 3,916 through 3,930 (of 8,731 total)