Viewing 15 posts - 61 through 75 (of 78 total)
try this...
IF OBJECT_ID('tempdb..#Foo') IS NOT NULL
DROP TABLE #Foo
CREATE TABLE #Foo
(
DecimalData decimal(10,9)
)
INSERT INTO #Foo VALUES(0.03464120)
INSERT...
Gary Johnson
Sr Database Engineer
September 3, 2008 at 7:58 pm
rbarryyoung (9/3/2008)
Gary Johnson
Sr Database Engineer
September 3, 2008 at 7:24 pm
IMHO, even though you can use TSQL to get the information, I would still simply right click on Master in the Object Explorer window and then click on Tasks/Generate Scripts......
Gary Johnson
Sr Database Engineer
September 3, 2008 at 2:33 pm
Hey, this is neat. I hadn't found the sys_modules before. So much easier than having to concatenate the syscomments text field!
Run the following with results to text. It'll script out...
Gary Johnson
Sr Database Engineer
September 3, 2008 at 12:53 pm
I think in this instance, I would create an SSIS package that does what you want. Then call the package on the command line.
Or I would simply use SQLCMD statements...
Gary Johnson
Sr Database Engineer
September 3, 2008 at 11:17 am
While you CAN make a database that uses the actual date, the question sometimes becomes SHOULD I.
We have a table with over 15.5 billion rows in it (increases daily...
Gary Johnson
Sr Database Engineer
September 2, 2008 at 6:29 pm
While being able to step through the code in Visual Studio is very helpful, don't discount using print and select statements as well. I will often have a parameter for...
Gary Johnson
Sr Database Engineer
August 28, 2008 at 3:18 pm
If you are using 2005 you would be able to use the new Rank feature to do your cross tab rather than my Right function. ![]()
Gary Johnson
Sr Database Engineer
May 23, 2006 at 3:30 pm
Give this a try...
IF OBJECT_ID('tempdb..#Wrk') IS NOT NULL
DROP TABLE #Wrk
IF OBJECT_ID('tempdb..#SubParts') IS NOT NULL
DROP TABLE #SubParts
CREATE TABLE #SubParts
(
...
Gary Johnson
Sr Database Engineer
May 22, 2006 at 9:25 pm
Steve,
Great job! I've run into this a few times. And it has always puzzled me why the 8060 wasn't correct. Now I know. Thanks!
Gary Johnson
Sr Database Engineer
May 22, 2006 at 11:19 am
Try something like this...
SELECT 'GRANT SELECT, INSERT, UPDATE ON ' + name + ' TO faelogin'
FROM sysobjects
WHERE type = 'U' and status >= 0
Then copy the resulting script and run...
Gary Johnson
Sr Database Engineer
October 4, 2005 at 3:40 am
Naming conventions are difficult to make useful ALL OF THE TIME. I'm currently working at a place that uses a strict naming convention. Our SPs are named by project_method_action_sp. Unfortunately...
Gary Johnson
Sr Database Engineer
October 3, 2005 at 12:58 pm
A long time ago I came across an sp called sp_select on the old site. I have since taken that sp and modified it, munged it so that now I have...
Gary Johnson
Sr Database Engineer
September 29, 2005 at 6:59 pm
The easiest way would be to use the convert as above but use switch 8 instead of 113. That will give you just hh:mm:ss. If you need milliseconds you can...
Gary Johnson
Sr Database Engineer
September 28, 2005 at 12:36 pm
Try this from BOL
SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\Finance\account.xls";User ID=Admin;Password=;Extended properties=Excel 8.0')...xactions
Also note that everything inside the parenthesis can not be set to a variable so if it needs to change...
Gary Johnson
Sr Database Engineer
September 15, 2005 at 6:27 pm
Viewing 15 posts - 61 through 75 (of 78 total)