Viewing 14 posts - 31 through 44 (of 44 total)
or another possible option is that the database is perhaps being restored by an automated process and then changed from simple to full recovery. Again check error logs and also...
November 20, 2013 at 9:48 pm
Between the time it is working and the time it is breaking, there has to be some process that is causing the database to change recovery modes (or even possibly...
November 20, 2013 at 9:46 pm
So take the working sql you have and convert it in to dynamic passing in the column names. You may face trouble it the number of columns change though. It...
November 20, 2013 at 6:02 pm
Apologies. I was just querying the sys.databases table to demonstrate how you would call dynamic sql. Yours would be something more like...
ALTER procedure [dbo].[totalinstallations]
@importedquery nvarchar(1000),
@coltotal nvarchar(1000)
AS
BEGIN
EXEC ('
SELECT '...
November 20, 2013 at 5:51 pm
Actually, you should be able to use isnumeric() function to get what you want to do....
e.g.
declare @test-2 table (col1 varchar(50))
insert into @test-2 values...
November 20, 2013 at 5:46 pm
I guess you can go down the dynamic sql then
e.g.
declare @columnName varchar(128)
set @columnName = 'name'
exec ('select ' + @columnName + ' from sys.databases')
As for your second question, yes there...
November 20, 2013 at 5:36 pm
Agreed with Sean. Backup and restore. You database name is order but that does not necessarily mean your datafile name is order.mdf. If you need to find out the name...
November 20, 2013 at 5:27 pm
The error that it gives you is correct. Lets say your report connects to the local database as reportuser1 on server1. In your linked server, on server1 which connects to...
November 20, 2013 at 5:19 pm
So there is your issue. In the stored procedure that gives you an error, you are trying to convert the text string 'installations' in to an integer which gives you...
November 20, 2013 at 5:14 pm
To make it simpler, your first query you are doing the same as
select SUM( DISTINCT CAST('installations' AS int)) as Total
It almost looks like by your question that you want...
November 20, 2013 at 5:06 pm
In your first example you are passing the text value of 'installations' in to your input parameter @coltotal and then trying to cast that to an integer which will fail...
November 20, 2013 at 5:00 pm
Ok it seems that these "hidden indexes" actually have is_hypothetical =1 from the dta run that was doen before my time. I need to look in to this more as...
November 19, 2013 at 11:12 pm
Ok so as I understand it, it is both an index and a statistic as they both exist in sys.indexes and sys.stats. My question now changes to, how come that...
November 19, 2013 at 11:02 pm
Perhaps look in to doing a bulk insert call?
November 19, 2013 at 9:29 pm
Viewing 14 posts - 31 through 44 (of 44 total)