Viewing 15 posts - 9,226 through 9,240 (of 13,461 total)
i have this saved in part of my snippets; it's scripting all the users for every role ; you could parameterize it to limit it to one role if desired:
--example...
June 17, 2010 at 6:31 am
in TSQL, you'll want to use the DATADD function. when you add a negative number, it subtracts it from the date: you can use it to add or subtract any...
June 17, 2010 at 6:17 am
it's been removed as a separate executable, and is all the pieces are moved around a bit, but are accessible in part of SSMS:
June 16, 2010 at 3:50 pm
ok try this as a proof of concept: in your Sandbox, do a Select * into newtable from sometable, and then run this query:
i'm using FORXML to concat all the...
June 16, 2010 at 2:53 pm
well syntactically, i think this is correct, but it's untested:
SELECT * FROM OPENQUERY( [linked server],'SET FMTONLY OFF; EXEC (''declare @body1 varchar(4000)
set @body1 = ''New Website Product as of '' +...
June 16, 2010 at 12:56 pm
it might also be parameter sniffing; if you have parameters with default values on them, a query plan is probably built assuming the default value (ie myproc(@The date datetime =...
June 16, 2010 at 12:51 pm
Set @Job = '<HTML>The following opportunity has been changed to ' + @Stage + ': '
+ '<br />'
+'Subject: '+ @Subject
+ '<br />'
+'Project Number: '+ @ProjectNumber
+ '<br...
June 16, 2010 at 12:44 pm
DBCC SHRINKFILE is granted to the roles sysadmin and db_owner
to remove permissions from a user, you'd most likely take away the db_owner role from them.
there is no other way...
June 16, 2010 at 11:44 am
it might be more clear if it looked like this...the zero is the first date in SQL:
select DATEADD(wk, DATEDIFF(wk,'19000101 00:00:00.000',getdate()), '19000101 00:00:00.000')
--is the same as
select DATEADD(wk, DATEDIFF(wk,0,getdate()), '19000101 00:00:00.000')
--is the...
June 16, 2010 at 8:24 am
Dan this is one of the coolest things to use once you get your head wrapped around it.
if you select DATEDIFF(wk,0,getdate())
this will return week '5763' , which is the #...
June 16, 2010 at 8:15 am
you can use the DATEADD and DATEDIFF function to determine the monday of the current week.
--Monday of the Current Week
select DATEADD(wk, DATEDIFF(wk,0,getdate()), 0)
so you want to avoid converting a datetime...
June 16, 2010 at 7:45 am
Steve i made an ITVF based on your example, but i added a bit more to it;
i was thinking if i allow periods in the data, i need to check...
June 16, 2010 at 7:35 am
you probably heard wrong, i think.
a SSRSreport is saved to a .rdl file(RDL=report definition language?), which is xml for the report's structure,design,location of all it's objects, etc.
that is what your...
June 16, 2010 at 5:24 am
calvo's example is exactly correct, i think; the EXEC() statement is stand alone, and does not affect the session/window it is a part of.
so to do what you want, you...
June 15, 2010 at 11:01 am
this will give you the results featuring row_number(); use the inner portion of the query to see the raw results, the outer query returns just the duplicate items:
productname,colorcode,categoryname,brandname,colorname
SELECT * FROM...
June 15, 2010 at 9:22 am
Viewing 15 posts - 9,226 through 9,240 (of 13,461 total)