Viewing 15 posts - 31 through 45 (of 77 total)
If you are running the batch of sequential scripts from batch file using SQLCMD try doing this...
SELECT * FROM $(DatabaseName).dbo.tablename
Then you simply set an environment variable in your command file...
September 10, 2008 at 12:41 pm
You can do a work around that would allow that to be done. BUT performance would likely be terrible. In my experience inline funtions like that perform horribly.
Why can't...
September 10, 2008 at 12:21 pm
To debug in Visual Studio you need to open the Server Explorer window. Add a data source for your database. Then drill down to the stored procedure. Right click on...
September 10, 2008 at 11:52 am
First thing I would do is to put a lot of debugging select statements and print statements in the SP (I wrap them in a comment block to know where...
September 9, 2008 at 7:10 pm
How about this?
declare @Sql nvarchar(max)
SET @Sql = ''
SELECT @Sql = @Sql + ' SELECT ' + name + ' FROM dbo.Property UNION' + char(13) + char(10)
FROM sys.columns
WHERE object_id = object_id('Property')
SET...
September 9, 2008 at 6:59 pm
Hmmm... I would have written it this way.
DELETE t3
FROM dbo.Table_3 t3
JOIN dbo.Table_1 t1
ON t3.Reqnr = t1.Reqnr
...
September 9, 2008 at 6:46 pm
Great news on the new minimal logging ability in 2008! I'm sure as we move data around quite often we will look for that feature.
This might just be one...
September 9, 2008 at 6:12 pm
Let me get on my soap box.
If you were to have scripts in source control for every object in your database this would be a non issue. 🙂
Getting off...
September 9, 2008 at 3:53 pm
Ninja's_RGR'us (9/9/2008)
Are you sure you didn't have other problems like blocking, index building, too much data...
September 9, 2008 at 3:38 pm
IMHO, WITH(NOCLOCK) is a tool like any other sql statement. Used incorrectly it can certainly bite ya. But so can many other things in SQL! 🙂
Our web facing data is...
September 9, 2008 at 3:13 pm
I have to ask. What is this for?
Sounds like you are creating a flat file with a header. Yuk...
I would create an SP that has a temp table you...
September 9, 2008 at 2:39 pm
SELECT INTO will often times be significantly faster. BUT it locks up the sysobjects table while it runs. So, if you have any other SPs or scripts(that need to DDL...
September 9, 2008 at 2:30 pm
OK.. Well this is a little more dynamic 🙂
IF OBJECT_ID('tempdb..#units') IS NOT NULL
DROP TABLE #units
CREATE TABLE #units (
buildingINT,
unitVARCHAR(25),
sort_orderINT
);
INSERT INTO#units
( building, unit )
SELECT 1, 'A' UNION ALL
SELECT...
September 9, 2008 at 2:18 pm
It is actually a combination of both what Mark and GSquared posted. It means that SQL Server is going to use the Code Page 1252 characters and searches are Case...
September 8, 2008 at 8:28 pm
If your CityType field is null where you don't have a primary city you should be able to simply use Coalesce.
SELECT DISTINCT
st.city,
...
September 8, 2008 at 8:17 pm
Viewing 15 posts - 31 through 45 (of 77 total)