Showing posts with label script. Show all posts
Showing posts with label script. Show all posts

Friday, March 30, 2012

Invoking or sending SQL queries using dOS

Hello Folks,
I want to create a simple batch DOS script to query mi SQL Server 2000 database. How I could do this?
I just want to run a select for a table but I dont want people to interct with sql query analyzer or enterprise manager to avoid any issues.
Regards,Look up OSQL or ISQL in Books Online.

Basically:
OSQL -S <name of your server/instance> -U <UID> -P <PWD> -d <Database to use> -Q"<your select statment>" -n -b

I do this all the time so post back if you have more questions.|||Originally posted by Paul Young
Look up OSQL or ISQL in Books Online.

Basically:
OSQL -S <name of your server/instance> -U <UID> -P <PWD> -d <Database to use> -Q"<your select statment>" -n -b

I do this all the time so post back if you have more questions.

UID stands for? PWD I assume is the pasword, isnt.

How I can redirect the results to a txt file,

OSQL -S OSQL -S <name of your server/instance> -U <UID> -P <PWD> -d <Database to use> -Q"<your select statment>" -n -b >> query.txt

Am I right?

Thanks for your prompt reply and help|||UID = User ID

You could pipe the output to a text file but the -o parm would be more usefull.|||How I can get the instance name. I have tested in my environment and I got the next error:

[DBNETLIB] Sql Server does not exist or access denied
[DBNETLIB] ConnectionOpen <Connect(())

As per this result I checked the server name I used typing osql -L. I got the names and used them but with the same result.

When I open the Sql query analyzer I connect using windows authentication option to connect to my databases.

Please suggest..|||For Windows Security I think you need to use -E option instead of -U and -P options.

Tim Ssql

Friday, March 23, 2012

Invalid object name 'db_student.myuser.tbl_studentname'.

HI, i am a newbie of SQL server.
What I got is an error shown as the title in which an ASP file made the SQL
call.
The script is just as follow:
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_cia_STRING
'Recordset1.Source = "SELECT * FROM fund WHERE studentno='k01' and remark
='confirm' ORDER BY date DESC"
Recordset1.Source = "db_aia..po_student_socre 'K01',' ',1"
Recordset1.CursorType = 1
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
I am sure that the procedure po_student_score exist and have set the execute
permission for the user with username myuser.
How can I solve the problem?
Thank you very much.
Hi,
First see the spelling of the procedure, the SCORE is spelled as SOCRE..
Recordset1.Source = "db_aia..po_student_socre 'K01',' ',1"
Thanks
Hari
MCDBA
<blue> wrote in message news:%231E%23aCUmEHA.1672@.TK2MSFTNGP14.phx.gbl...
> HI, i am a newbie of SQL server.
> What I got is an error shown as the title in which an ASP file made the
> SQL
> call.
> The script is just as follow:
> set Recordset1 = Server.CreateObject("ADODB.Recordset")
> Recordset1.ActiveConnection = MM_cia_STRING
> 'Recordset1.Source = "SELECT * FROM fund WHERE studentno='k01' and
> remark
> ='confirm' ORDER BY date DESC"
> Recordset1.Source = "db_aia..po_student_socre 'K01',' ',1"
> Recordset1.CursorType = 1
> Recordset1.CursorLocation = 2
> Recordset1.LockType = 3
> Recordset1.Open()
> I am sure that the procedure po_student_score exist and have set the
> execute
> permission for the user with username myuser.
> How can I solve the problem?
> Thank you very much.
>

Monday, March 12, 2012

Invalid Connection message

I have a database running under MSDE 2000 to which I can connect either
through MS Access or Coldfusion. However, I wanted to run a script at the
command prompt to try and have an automatic backup.
I typed OSQL -Usa -P at the command prompt and supplied a valid password but
after a few moments I got back:
[Shared Memory] Invalid connection.
[Shared Memory]ConnectionOpen (Invalid Instance()).
Can anyone point me in the right direction as to what might be wrong?
many thanks
june
hi June,
June Macleod wrote:
> I have a database running under MSDE 2000 to which I can connect
> either through MS Access or Coldfusion. However, I wanted to run a
> script at the command prompt to try and have an automatic backup.
> I typed OSQL -Usa -P at the command prompt and supplied a valid
> password but after a few moments I got back:
> [Shared Memory] Invalid connection.
> [Shared Memory]ConnectionOpen (Invalid Instance()).
>
did you provide the correct instance name in the form
osql -S(local)\InstanceName
?
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Thank you, that was the problem. I will now attempt to run my script.
June
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:3p0ba1F82e2mU1@.individual.net...
> hi June,
> June Macleod wrote:
> did you provide the correct instance name in the form
> osql -S(local)\InstanceName
> ?
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>

Friday, March 9, 2012

Invalid column name

I am writing sql script where I have to get colum values from table and
do some processing and then delete those column. This is a new version
of the application and we don't need those columns anymore.
But the problem is that I need to be able to run this script more then
once without any errors. So, second time when I run it, it gives an
error that Invalid column name.
Before I get values from those columns, I check if they exists or not
and then get the value, but still it gives error, so I put everything
as string and use EXEC to execute that string - but still.
I don't know what to do.
I am copying my code here.
DECLARE @.value VARCHAR(8000)
SELECT @.value = 'SELECT @.Dining_Mod = 0 ' +
' IF (EXISTS(SELECT * FROM dbo.syscolumns WHERE name IN
(''DINING_ROOM_MOD_SQFT'') ' +
' AND id = (SELECT id FROM dbo.sysobjects WHERE id =
object_id(N''[dbo].[RESTAURANT]'') AND OBJECTPROPERTY(id,
N''IsUserTable'') = 1))) ' +
' SELECT @.Dining_Mod = DINING_ROOM_MOD_SQFT ' +
' FROM RESTAURANT ' +
' WHERE RESTAURANT_ID = @.Restaurant_Id ' +
' SELECT @.Dining_Mod = ISNULL(@.Dining_Mod, 0) '
exec (@.value)
The error I get is Invalid column name 'DINING_ROOM_MOD_SQFT'.
Anybody has any idea?
Thanks
Adnan Masood
www.newbalanceindy.comThis is just an idea, so you'll have to do the coding yourself (let me
know if that's a problem), but perhaps it would be better to not try to
do so much control flow in the dynamic sql. instead you could use the
stored procedures sp_tables and sp_columns, a couple nested of cursors
looping through these basically gives you a map of your database (not
very efficient, but dynamic without using exec). Once you've got this
you could build up a much more lightweight part of the dynamic sql,
making it far easier to debug.
As for why you're getting that error - are you regenerating the dynamic
sql on the second run? perhaps using sp_executesql will be get around
it as it will regenerate the query plan.
Cheers
Will|||Print the contents of the @.value variable and see what is wrong. If you don'
t find it, post it here.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Sehboo" <MasoodAdnan@.gmail.com> wrote in message
news:1145289437.588507.216360@.i39g2000cwa.googlegroups.com...
>I am writing sql script where I have to get colum values from table and
> do some processing and then delete those column. This is a new version
> of the application and we don't need those columns anymore.
> But the problem is that I need to be able to run this script more then
> once without any errors. So, second time when I run it, it gives an
> error that Invalid column name.
> Before I get values from those columns, I check if they exists or not
> and then get the value, but still it gives error, so I put everything
> as string and use EXEC to execute that string - but still.
> I don't know what to do.
> I am copying my code here.
> DECLARE @.value VARCHAR(8000)
> SELECT @.value = 'SELECT @.Dining_Mod = 0 ' +
> ' IF (EXISTS(SELECT * FROM dbo.syscolumns WHERE name IN
> (''DINING_ROOM_MOD_SQFT'') ' +
> ' AND id = (SELECT id FROM dbo.sysobjects WHERE id =
> object_id(N''[dbo].[RESTAURANT]'') AND OBJECTPROPERTY(id,
> N''IsUserTable'') = 1))) ' +
> ' SELECT @.Dining_Mod = DINING_ROOM_MOD_SQFT ' +
> ' FROM RESTAURANT ' +
> ' WHERE RESTAURANT_ID = @.Restaurant_Id ' +
> ' SELECT @.Dining_Mod = ISNULL(@.Dining_Mod, 0) '
> exec (@.value)
> The error I get is Invalid column name 'DINING_ROOM_MOD_SQFT'.
> Anybody has any idea?
> Thanks
> Adnan Masood
> www.newbalanceindy.com
>|||Here is my code:
DECLARE @.value VARCHAR(8000)
SELECT @.value =
'DECLARE @.Dining_Mod smallint ' +
' IF (EXISTS(SELECT * FROM dbo.syscolumns WHERE name IN
(''DINING_ROOM_MOD_SQFT'') ' +
' AND id = (SELECT id FROM dbo.sysobjects WHERE id =
object_id(N''[dbo].[RESTAURANT]'') AND OBJECTPROPERTY(id,
N''IsUserTable'') = 1))) ' +
' SELECT @.Dining_Mod = DINING_ROOM_MOD_SQFT ' +
' FROM RESTAURANT ' +
' WHERE RESTAURANT_ID = 1 '
print @.value
EXEC (@.value)
Here is what I get in the print
DECLARE @.Dining_Mod smallint
IF (EXISTS(SELECT * FROM dbo.syscolumns WHERE name IN
('DINING_ROOM_MOD_SQFT')
AND id = (SELECT id FROM dbo.sysobjects WHERE id =
object_id(N'[dbo].[RESTAURANT]') AND OBJECTPROPERTY(id, N'IsUserTable')
= 1)))
SELECT @.Dining_Mod = DINING_ROOM_MOD_SQFT
FROM RESTAURANT
WHERE RESTAURANT_ID = 1
...and here is the error:
Server: Msg 207, Level 16, State 3, Line 1
Invalid column name 'DINING_ROOM_MOD_SQFT'.
Because this column has been delete in the first run of the script. I
need to be able to run this as many times as I want.
Thanks
Any help will be appreciated.
Adnan Masood
http://www.newbalanceindy.com|||The problem is that when the parsing of the statement is performed, the prio
r IF statement isn't in
effect yet. So, the error that the column isn't there is returned at the par
sing stage, not
execution. Seems you have to break down this into two batches.
A more serious question would be why you need to do this check. A voilile sc
hema often indicates
problems with the data model.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Sehboo" <MasoodAdnan@.gmail.com> wrote in message
news:1145295533.954382.286730@.t31g2000cwb.googlegroups.com...
> Here is my code:
> DECLARE @.value VARCHAR(8000)
> SELECT @.value =
> 'DECLARE @.Dining_Mod smallint ' +
> ' IF (EXISTS(SELECT * FROM dbo.syscolumns WHERE name IN
> (''DINING_ROOM_MOD_SQFT'') ' +
> ' AND id = (SELECT id FROM dbo.sysobjects WHERE id =
> object_id(N''[dbo].[RESTAURANT]'') AND OBJECTPROPERTY(id,
> N''IsUserTable'') = 1))) ' +
> ' SELECT @.Dining_Mod = DINING_ROOM_MOD_SQFT ' +
> ' FROM RESTAURANT ' +
> ' WHERE RESTAURANT_ID = 1 '
>
> print @.value
> EXEC (@.value)
> Here is what I get in the print
> DECLARE @.Dining_Mod smallint
> IF (EXISTS(SELECT * FROM dbo.syscolumns WHERE name IN
> ('DINING_ROOM_MOD_SQFT')
> AND id = (SELECT id FROM dbo.sysobjects WHERE id =
> object_id(N'[dbo].[RESTAURANT]') AND OBJECTPROPERTY(id, N'IsUserTable')
> = 1)))
> SELECT @.Dining_Mod = DINING_ROOM_MOD_SQFT
> FROM RESTAURANT
> WHERE RESTAURANT_ID = 1
> ...and here is the error:
> Server: Msg 207, Level 16, State 3, Line 1
> Invalid column name 'DINING_ROOM_MOD_SQFT'.
>
> Because this column has been delete in the first run of the script. I
> need to be able to run this as many times as I want.
> Thanks
> Any help will be appreciated.
> Adnan Masood
> http://www.newbalanceindy.com
>|||IF you need to drop a column, why not remove it from this script entirely
and handle the column in a different script that will only be run once? You
really shouldnt have production code running on a regular basis for a task
that will only be done once. Run once what needs to be run once, then never
reference the code again.
I can't think of a reason to write code in a reusable procedure for a field
that is not going to exist. If you explain why you are doing this and what
this field is for you will probably get some good advice on alternative
approaches.
"Sehboo" <MasoodAdnan@.gmail.com> wrote in message
news:1145289437.588507.216360@.i39g2000cwa.googlegroups.com...
> I am writing sql script where I have to get colum values from table and
> do some processing and then delete those column. This is a new version
> of the application and we don't need those columns anymore.
> But the problem is that I need to be able to run this script more then
> once without any errors. So, second time when I run it, it gives an
> error that Invalid column name.
> Before I get values from those columns, I check if they exists or not
> and then get the value, but still it gives error, so I put everything
> as string and use EXEC to execute that string - but still.
> I don't know what to do.
> I am copying my code here.
> DECLARE @.value VARCHAR(8000)
> SELECT @.value = 'SELECT @.Dining_Mod = 0 ' +
> ' IF (EXISTS(SELECT * FROM dbo.syscolumns WHERE name IN
> (''DINING_ROOM_MOD_SQFT'') ' +
> ' AND id = (SELECT id FROM dbo.sysobjects WHERE id =
> object_id(N''[dbo].[RESTAURANT]'') AND OBJECTPROPERTY(id,
> N''IsUserTable'') = 1))) ' +
> ' SELECT @.Dining_Mod = DINING_ROOM_MOD_SQFT ' +
> ' FROM RESTAURANT ' +
> ' WHERE RESTAURANT_ID = @.Restaurant_Id ' +
> ' SELECT @.Dining_Mod = ISNULL(@.Dining_Mod, 0) '
> exec (@.value)
> The error I get is Invalid column name 'DINING_ROOM_MOD_SQFT'.
> Anybody has any idea?
> Thanks
> Adnan Masood
> www.newbalanceindy.com
>

invalid column name

When I try to run this script I get the 'invalid column name error. Can
anyone tell me what I need to do to correct the error?
SELECT PROVIDER.PROV_PATH,
INSAGRE.PROV_ID,
PROVIDER.NAME,
INSEMPL.EMP_MO,
INSEMPL.EMP_YR,
INSEMPL.EMP_CNT,
CAST(cast([EMP_MO] as varchar) + '/1/' + CAST([EMP_YR] as varchar)
as datetime) AS MonthYear
INTO #Temp
FROM INSEMPL
INNER JOIN INSAGRE ON INSEMPL.INSAGRE_ID = INSAGRE.INSAGRE_ID
INNER JOIN PROVIDER ON INSAGRE.PROV_ID = PROVIDER.PROV_ID
WHERE (PROVIDER.PROV_PATH = 4)
-- Get Last Update Date
SELECT Max(MonthYear) as MaxMonthYear, INSAGRE_ID
INTO #Temp1
FROM #Temp
Group by INSAGRE_ID
-- Select Info from Last Update Date
SELECT t.*
FROM #Temp t INNER JOIN #Temp1 t1 ON t1.Prov_ID = t.Prov_ID AND
t1.MaxMonthYear = t.MonthYear
-- Clean Up
DROP TABLE #Temp
DROP TABLE #Temp1
--
Message posted via http://www.sqlmonster.comI think it's an invalid error message. The problem is that you are
running them all together as one batch. and the #Temp doesn't exist, so the
select's from #temp burp.. See if adding a go in between helps, or try
running them one at a time..
Bill
"Jay via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:136dcaa2482a4c0b8e96f1235bd182b8@.SQLMonster.com...
> When I try to run this script I get the 'invalid column name error. Can
> anyone tell me what I need to do to correct the error?
> SELECT PROVIDER.PROV_PATH,
> INSAGRE.PROV_ID,
> PROVIDER.NAME,
> INSEMPL.EMP_MO,
> INSEMPL.EMP_YR,
> INSEMPL.EMP_CNT,
> CAST(cast([EMP_MO] as varchar) + '/1/' + CAST([EMP_YR] as varchar)
> as datetime) AS MonthYear
> INTO #Temp
> FROM INSEMPL
> INNER JOIN INSAGRE ON INSEMPL.INSAGRE_ID = INSAGRE.INSAGRE_ID
> INNER JOIN PROVIDER ON INSAGRE.PROV_ID = PROVIDER.PROV_ID
> WHERE (PROVIDER.PROV_PATH = 4)
>
> -- Get Last Update Date
> SELECT Max(MonthYear) as MaxMonthYear, INSAGRE_ID
> INTO #Temp1
> FROM #Temp
> Group by INSAGRE_ID
>
> -- Select Info from Last Update Date
> SELECT t.*
> FROM #Temp t INNER JOIN #Temp1 t1 ON t1.Prov_ID = t.Prov_ID AND
> t1.MaxMonthYear = t.MonthYear
> -- Clean Up
> DROP TABLE #Temp
> DROP TABLE #Temp1
> --
> Message posted via http://www.sqlmonster.com|||It looks like #Temp doesn't have an INSAGER_ID column, so the statement:
SELECT Max(MonthYear) as MaxMonthYear, INSAGRE_ID
INTO #Temp1
FROM #Temp
Group by INSAGRE_ID
Is probably generating the error. Try adding an INSAGRE_ID column to the
SELECT ... INTO #Temp statement.
"Jay via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:136dcaa2482a4c0b8e96f1235bd182b8@.SQLMonster.com...
> When I try to run this script I get the 'invalid column name error. Can
> anyone tell me what I need to do to correct the error?
> SELECT PROVIDER.PROV_PATH,
> INSAGRE.PROV_ID,
> PROVIDER.NAME,
> INSEMPL.EMP_MO,
> INSEMPL.EMP_YR,
> INSEMPL.EMP_CNT,
> CAST(cast([EMP_MO] as varchar) + '/1/' + CAST([EMP_YR] as varchar)
> as datetime) AS MonthYear
> INTO #Temp
> FROM INSEMPL
> INNER JOIN INSAGRE ON INSEMPL.INSAGRE_ID = INSAGRE.INSAGRE_ID
> INNER JOIN PROVIDER ON INSAGRE.PROV_ID = PROVIDER.PROV_ID
> WHERE (PROVIDER.PROV_PATH = 4)
>
> -- Get Last Update Date
> SELECT Max(MonthYear) as MaxMonthYear, INSAGRE_ID
> INTO #Temp1
> FROM #Temp
> Group by INSAGRE_ID
>
> -- Select Info from Last Update Date
> SELECT t.*
> FROM #Temp t INNER JOIN #Temp1 t1 ON t1.Prov_ID = t.Prov_ID AND
> t1.MaxMonthYear = t.MonthYear
> -- Clean Up
> DROP TABLE #Temp
> DROP TABLE #Temp1
> --
> Message posted via http://www.sqlmonster.com|||I am getting this error when trying to open up a new diagram through SQL
Enterprise Manager. Anyone got a solution for this? Invalid Column Name
'value'
"Jay via SQLMonster.com" wrote:
> When I try to run this script I get the 'invalid column name error. Can
> anyone tell me what I need to do to correct the error?
> SELECT PROVIDER.PROV_PATH,
> INSAGRE.PROV_ID,
> PROVIDER.NAME,
> INSEMPL.EMP_MO,
> INSEMPL.EMP_YR,
> INSEMPL.EMP_CNT,
> CAST(cast([EMP_MO] as varchar) + '/1/' + CAST([EMP_YR] as varchar)
> as datetime) AS MonthYear
> INTO #Temp
> FROM INSEMPL
> INNER JOIN INSAGRE ON INSEMPL.INSAGRE_ID = INSAGRE.INSAGRE_ID
> INNER JOIN PROVIDER ON INSAGRE.PROV_ID = PROVIDER.PROV_ID
> WHERE (PROVIDER.PROV_PATH = 4)
>
> -- Get Last Update Date
> SELECT Max(MonthYear) as MaxMonthYear, INSAGRE_ID
> INTO #Temp1
> FROM #Temp
> Group by INSAGRE_ID
>
> -- Select Info from Last Update Date
> SELECT t.*
> FROM #Temp t INNER JOIN #Temp1 t1 ON t1.Prov_ID = t.Prov_ID AND
> t1.MaxMonthYear = t.MonthYear
> -- Clean Up
> DROP TABLE #Temp
> DROP TABLE #Temp1
> --
> Message posted via http://www.sqlmonster.com
>

invalid column name

When I try to run this script I get the 'invalid column name error. Can
anyone tell me what I need to do to correct the error?
SELECT PROVIDER.PROV_PATH,
INSAGRE.PROV_ID,
PROVIDER.NAME,
INSEMPL.EMP_MO,
INSEMPL.EMP_YR,
INSEMPL.EMP_CNT,
CAST(cast([EMP_MO] as varchar) + '/1/' + CAST([EMP_YR] as varchar)
as datetime) AS MonthYear
INTO #Temp
FROM INSEMPL
INNER JOIN INSAGRE ON INSEMPL.INSAGRE_ID = INSAGRE.INSAGRE_ID
INNER JOIN PROVIDER ON INSAGRE.PROV_ID = PROVIDER.PROV_ID
WHERE (PROVIDER.PROV_PATH = 4)
-- Get Last Update Date
SELECT Max(MonthYear) as MaxMonthYear, INSAGRE_ID
INTO #Temp1
FROM #Temp
Group by INSAGRE_ID
-- Select Info from Last Update Date
SELECT t.*
FROM #Temp t INNER JOIN #Temp1 t1 ON t1.Prov_ID = t.Prov_ID AND
t1.MaxMonthYear = t.MonthYear
-- Clean Up
DROP TABLE #Temp
DROP TABLE #Temp1
Message posted via http://www.droptable.comI think it's an invalid error message. The problem is that you are
running them all together as one batch. and the #Temp doesn't exist, so the
select's from #temp burp.. See if adding a go in between helps, or try
running them one at a time..
Bill
"Jay via droptable.com" <forum@.droptable.com> wrote in message
news:136dcaa2482a4c0b8e96f1235bd182b8@.SQ
droptable.com...
> When I try to run this script I get the 'invalid column name error. Can
> anyone tell me what I need to do to correct the error?
> SELECT PROVIDER.PROV_PATH,
> INSAGRE.PROV_ID,
> PROVIDER.NAME,
> INSEMPL.EMP_MO,
> INSEMPL.EMP_YR,
> INSEMPL.EMP_CNT,
> CAST(cast([EMP_MO] as varchar) + '/1/' + CAST([EMP_YR] as v
archar)
> as datetime) AS MonthYear
> INTO #Temp
> FROM INSEMPL
> INNER JOIN INSAGRE ON INSEMPL.INSAGRE_ID = INSAGRE.INSAGRE_ID
> INNER JOIN PROVIDER ON INSAGRE.PROV_ID = PROVIDER.PROV_ID
> WHERE (PROVIDER.PROV_PATH = 4)
>
> -- Get Last Update Date
> SELECT Max(MonthYear) as MaxMonthYear, INSAGRE_ID
> INTO #Temp1
> FROM #Temp
> Group by INSAGRE_ID
>
> -- Select Info from Last Update Date
> SELECT t.*
> FROM #Temp t INNER JOIN #Temp1 t1 ON t1.Prov_ID = t.Prov_ID AND
> t1.MaxMonthYear = t.MonthYear
> -- Clean Up
> DROP TABLE #Temp
> DROP TABLE #Temp1
> --
> Message posted via http://www.droptable.com|||It looks like #Temp doesn't have an INSAGER_ID column, so the statement:
SELECT Max(MonthYear) as MaxMonthYear, INSAGRE_ID
INTO #Temp1
FROM #Temp
Group by INSAGRE_ID
Is probably generating the error. Try adding an INSAGRE_ID column to the
SELECT ... INTO #Temp statement.
"Jay via droptable.com" <forum@.droptable.com> wrote in message
news:136dcaa2482a4c0b8e96f1235bd182b8@.SQ
droptable.com...
> When I try to run this script I get the 'invalid column name error. Can
> anyone tell me what I need to do to correct the error?
> SELECT PROVIDER.PROV_PATH,
> INSAGRE.PROV_ID,
> PROVIDER.NAME,
> INSEMPL.EMP_MO,
> INSEMPL.EMP_YR,
> INSEMPL.EMP_CNT,
> CAST(cast([EMP_MO] as varchar) + '/1/' + CAST([EMP_YR] as v
archar)
> as datetime) AS MonthYear
> INTO #Temp
> FROM INSEMPL
> INNER JOIN INSAGRE ON INSEMPL.INSAGRE_ID = INSAGRE.INSAGRE_ID
> INNER JOIN PROVIDER ON INSAGRE.PROV_ID = PROVIDER.PROV_ID
> WHERE (PROVIDER.PROV_PATH = 4)
>
> -- Get Last Update Date
> SELECT Max(MonthYear) as MaxMonthYear, INSAGRE_ID
> INTO #Temp1
> FROM #Temp
> Group by INSAGRE_ID
>
> -- Select Info from Last Update Date
> SELECT t.*
> FROM #Temp t INNER JOIN #Temp1 t1 ON t1.Prov_ID = t.Prov_ID AND
> t1.MaxMonthYear = t.MonthYear
> -- Clean Up
> DROP TABLE #Temp
> DROP TABLE #Temp1
> --
> Message posted via http://www.droptable.com|||I am getting this error when trying to open up a new diagram through SQL
Enterprise Manager. Anyone got a solution for this? Invalid Column Name
'value'
"Jay via droptable.com" wrote:

> When I try to run this script I get the 'invalid column name error. Can
> anyone tell me what I need to do to correct the error?
> SELECT PROVIDER.PROV_PATH,
> INSAGRE.PROV_ID,
> PROVIDER.NAME,
> INSEMPL.EMP_MO,
> INSEMPL.EMP_YR,
> INSEMPL.EMP_CNT,
> CAST(cast([EMP_MO] as varchar) + '/1/' + CAST([EMP_YR] as
varchar)
> as datetime) AS MonthYear
> INTO #Temp
> FROM INSEMPL
> INNER JOIN INSAGRE ON INSEMPL.INSAGRE_ID = INSAGRE.INSAGRE_ID
> INNER JOIN PROVIDER ON INSAGRE.PROV_ID = PROVIDER.PROV_ID
> WHERE (PROVIDER.PROV_PATH = 4)
>
> -- Get Last Update Date
> SELECT Max(MonthYear) as MaxMonthYear, INSAGRE_ID
> INTO #Temp1
> FROM #Temp
> Group by INSAGRE_ID
>
> -- Select Info from Last Update Date
> SELECT t.*
> FROM #Temp t INNER JOIN #Temp1 t1 ON t1.Prov_ID = t.Prov_ID AND
> t1.MaxMonthYear = t.MonthYear
> -- Clean Up
> DROP TABLE #Temp
> DROP TABLE #Temp1
> --
> Message posted via http://www.droptable.com
>

invalid column name

When I try to run this script I get the 'invalid column name error. Can
anyone tell me what I need to do to correct the error?
SELECT PROVIDER.PROV_PATH,
INSAGRE.PROV_ID,
PROVIDER.NAME,
INSEMPL.EMP_MO,
INSEMPL.EMP_YR,
INSEMPL.EMP_CNT,
CAST(cast([EMP_MO] as varchar) + '/1/' + CAST([EMP_YR] as varchar)
as datetime) AS MonthYear
INTO #Temp
FROM INSEMPL
INNER JOIN INSAGRE ON INSEMPL.INSAGRE_ID = INSAGRE.INSAGRE_ID
INNER JOIN PROVIDER ON INSAGRE.PROV_ID = PROVIDER.PROV_ID
WHERE (PROVIDER.PROV_PATH = 4)
-- Get Last Update Date
SELECT Max(MonthYear) as MaxMonthYear, INSAGRE_ID
INTO #Temp1
FROM #Temp
Group by INSAGRE_ID
-- Select Info from Last Update Date
SELECT t.*
FROM #Temp t INNER JOIN #Temp1 t1 ON t1.Prov_ID = t.Prov_ID AND
t1.MaxMonthYear = t.MonthYear
-- Clean Up
DROP TABLE #Temp
DROP TABLE #Temp1
Message posted via http://www.sqlmonster.com
I think it's an invalid error message. The problem is that you are
running them all together as one batch. and the #Temp doesn't exist, so the
select's from #temp burp.. See if adding a go in between helps, or try
running them one at a time..
Bill
"Jay via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:136dcaa2482a4c0b8e96f1235bd182b8@.SQLMonster.c om...
> When I try to run this script I get the 'invalid column name error. Can
> anyone tell me what I need to do to correct the error?
> SELECT PROVIDER.PROV_PATH,
> INSAGRE.PROV_ID,
> PROVIDER.NAME,
> INSEMPL.EMP_MO,
> INSEMPL.EMP_YR,
> INSEMPL.EMP_CNT,
> CAST(cast([EMP_MO] as varchar) + '/1/' + CAST([EMP_YR] as varchar)
> as datetime) AS MonthYear
> INTO #Temp
> FROM INSEMPL
> INNER JOIN INSAGRE ON INSEMPL.INSAGRE_ID = INSAGRE.INSAGRE_ID
> INNER JOIN PROVIDER ON INSAGRE.PROV_ID = PROVIDER.PROV_ID
> WHERE (PROVIDER.PROV_PATH = 4)
>
> -- Get Last Update Date
> SELECT Max(MonthYear) as MaxMonthYear, INSAGRE_ID
> INTO #Temp1
> FROM #Temp
> Group by INSAGRE_ID
>
> -- Select Info from Last Update Date
> SELECT t.*
> FROM #Temp t INNER JOIN #Temp1 t1 ON t1.Prov_ID = t.Prov_ID AND
> t1.MaxMonthYear = t.MonthYear
> -- Clean Up
> DROP TABLE #Temp
> DROP TABLE #Temp1
> --
> Message posted via http://www.sqlmonster.com
|||It looks like #Temp doesn't have an INSAGER_ID column, so the statement:
SELECT Max(MonthYear) as MaxMonthYear, INSAGRE_ID
INTO #Temp1
FROM #Temp
Group by INSAGRE_ID
Is probably generating the error. Try adding an INSAGRE_ID column to the
SELECT ... INTO #Temp statement.
"Jay via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:136dcaa2482a4c0b8e96f1235bd182b8@.SQLMonster.c om...
> When I try to run this script I get the 'invalid column name error. Can
> anyone tell me what I need to do to correct the error?
> SELECT PROVIDER.PROV_PATH,
> INSAGRE.PROV_ID,
> PROVIDER.NAME,
> INSEMPL.EMP_MO,
> INSEMPL.EMP_YR,
> INSEMPL.EMP_CNT,
> CAST(cast([EMP_MO] as varchar) + '/1/' + CAST([EMP_YR] as varchar)
> as datetime) AS MonthYear
> INTO #Temp
> FROM INSEMPL
> INNER JOIN INSAGRE ON INSEMPL.INSAGRE_ID = INSAGRE.INSAGRE_ID
> INNER JOIN PROVIDER ON INSAGRE.PROV_ID = PROVIDER.PROV_ID
> WHERE (PROVIDER.PROV_PATH = 4)
>
> -- Get Last Update Date
> SELECT Max(MonthYear) as MaxMonthYear, INSAGRE_ID
> INTO #Temp1
> FROM #Temp
> Group by INSAGRE_ID
>
> -- Select Info from Last Update Date
> SELECT t.*
> FROM #Temp t INNER JOIN #Temp1 t1 ON t1.Prov_ID = t.Prov_ID AND
> t1.MaxMonthYear = t.MonthYear
> -- Clean Up
> DROP TABLE #Temp
> DROP TABLE #Temp1
> --
> Message posted via http://www.sqlmonster.com
|||I am getting this error when trying to open up a new diagram through SQL
Enterprise Manager. Anyone got a solution for this? Invalid Column Name
'value'
"Jay via droptable.com" wrote:

> When I try to run this script I get the 'invalid column name error. Can
> anyone tell me what I need to do to correct the error?
> SELECT PROVIDER.PROV_PATH,
> INSAGRE.PROV_ID,
> PROVIDER.NAME,
> INSEMPL.EMP_MO,
> INSEMPL.EMP_YR,
> INSEMPL.EMP_CNT,
> CAST(cast([EMP_MO] as varchar) + '/1/' + CAST([EMP_YR] as varchar)
> as datetime) AS MonthYear
> INTO #Temp
> FROM INSEMPL
> INNER JOIN INSAGRE ON INSEMPL.INSAGRE_ID = INSAGRE.INSAGRE_ID
> INNER JOIN PROVIDER ON INSAGRE.PROV_ID = PROVIDER.PROV_ID
> WHERE (PROVIDER.PROV_PATH = 4)
>
> -- Get Last Update Date
> SELECT Max(MonthYear) as MaxMonthYear, INSAGRE_ID
> INTO #Temp1
> FROM #Temp
> Group by INSAGRE_ID
>
> -- Select Info from Last Update Date
> SELECT t.*
> FROM #Temp t INNER JOIN #Temp1 t1 ON t1.Prov_ID = t.Prov_ID AND
> t1.MaxMonthYear = t.MonthYear
> -- Clean Up
> DROP TABLE #Temp
> DROP TABLE #Temp1
> --
> Message posted via http://www.droptable.com
>

Sunday, February 19, 2012

Internet explorer script error

When trying to configure task scheduler on my mcafee virus scan i get the error notice: keyset does not exist The specific error is 0x80090016 It also says General page initialisation failed. An error has occurred attempting to retrieve task account onfo. You may continue editing task object but will be unable to change task account info. Does anyone have a solution so I can schedule automatic updates for my virus scanner?What's this got to do with Internet Explorer scripting?|||Sorry the original error was: Internet explorer script error. An error has occurred on the csript on this page. Error is: Keyset does not exist Line 719 Char7 after further attempts to schedule antivirus scans on mcafee I got the error notice I first listed in this forum|||

This is a forum for SQL Server Reporting Services, not virus scanners. I think you'll have more luck trying to post your problem at http://forums.mcafeehelp.com/.

|||

I have also begun getting this error message and I do not use McAfee, I use Norton 2006. Since I installed it I get this error ?

|||Mcafee not able to sort this problem they suggested this forum but thankyou for your suggestion|||

Try posting your issue to the ASP "Client Side Web Development" forum, which deals with "Client-side programming discussions, including CSS, DHTML, JScript/Javascript, etc".

http://forums.asp.net/130/ShowForum.aspx

They may be able to help you out. I'd try including alot more information, though:

what's the error number?|||I have the same problem with Norton and other items in task scheduler. Symantic responds that it is a Windows problem in Task Scheduler. Windows Article ID 246183 responds to this problem, but only applies to Windows 2000. It requires a change in the registry. Look at it and see if it helps.

Internet Explorer 7 Release Candidate 1

After downloading and installing this update I find that java script doesn't work (e.g. I cannot now access news videos). I have checked in Tools and find that Scripting is enabled.

Can anyone assist me please as I rely on the Internet for news, not having a TV?

This forum is for SQL Server Reporting Services, and in general the MSDN forums target developer related questions, but you could try the Internet Explorer forum:

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=923&SiteID=1

You may also want to enable "Display a notification about every script error" on the Advanced tab of Tools->Options and provide the exact script error in your post.