i am trying to figure out if naming a table with a declared variable is possible. i have a stored procedure that runs one time a week. when i run the sproc, i enter a variable known as @weeknumber. i would like the result set to write to a table with the name of the @weeknumber variable. for...
hey all
having some trouble with this if else. getting errors like "error 209 - ambiguous column name emEmployee" this is because column emEmployee is in all of the joined tables. thanks for the help.
IF EXISTS (Select * From tblbonus WHERE emSelect1 = 'Salary')
Begin
Select...
i am having more problems exporting reprots to sql server. my report has a group header for the records it pulls from the source tables. when i try to export the report, the error message is "column names in each table must be unique. column GH2_employee in table CREXPORT is specified more...
i am trying to export a report into a table on a sql server. i am receiving error messages "Line1: syntax error near >". no more explanation is offered. where can i find out how to fix this error? it exports fine to excel
i am trying to export a report to a sql db and am receiving sql errors such as Line1: error near '>'. is there a way to find this error or get around it?
does anyone know the best place to find online or CD based SQL training? i need it to be self paced so that i can learn faster than a traditional training class. CD is better for me, but anything will do. thnx
ok- the whole code is included, and the lines that return errors are bold. thanks a lot.
CREATE PROCEDURE [dbo].[WeeklyBonus] AS
/* declare all variables*/
Begin
Declare @target int
Declare @vacused int
Declare @weeklydirecthours int
Declare @totalhoursworked int
Declare @bonuspayout...
how about on a line like this? the line is question is the first, in bold. there are many records where emselect1 = salary.
If (Select emSelect1 From EM) = "salary"
Set @paidhours = @weeksworked * 40
Else
Set @paidhours = @totalhours
i think the problem is i have not distinguished that...
i am now having difficulty with error 512,
"Server: Msg 512, Level 16, State 1, Procedure WeeklyBonus, Line 40
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression."
the issue is that there are...
the variable is defined, but the problem i am having is with if then syntax. the value will not be a column, etc., it will be the result of the entire if-then statement posted in my original message. i am not sure how to write that statement in SQL language to define the variable
I have a problem with defining variables in my stored procedure. i need the proc. to pull in a bunch of data and do some calc's with about 10 variables. the variable @productivity. is a series of if then statements and calculations. i do not know the proper syntax for this variale. please...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.