Showing posts with label parameters. Show all posts
Showing posts with label parameters. Show all posts

Friday, March 23, 2012

Help on INI file

Hi all,
I'm building a DTS package that needs to take parameters from an INI
file. The SQL statement in the Transform task goes something like this:
select * from customer where division in ('D','I','2','3','C')
I need to pass the division 'D','I','2','3','C' part in because there
might be more divisions we need in the future or change of divisions,
we don't want to modifiy the package every time. So I set it in the INI
file like this and read it into a global variable:
[Customer]
Division = 'D','I','2','3','C'
But SQL doesn't recognize the SQL statement "select * from customer
where division in (?), where ? stands for the global variable. I tried
with setting Division = "'D','I','2','3','C'" in INI file, it still
doesn't work. The only way it works is to pass the 5 values as 5
seperate parameters and thus 5 global variables then the SQL statement
is like this:
select * from customer where division in (?,?,?,?,?)
But this defeats the purpose because I can't add another parameter in
the INI file without having to open the package and make changes.
Has anybody run into this before? Any suggestions is appreciated.
Thanks,http://www.sommarskog.se/arrays-in-sql.html

Simon

Wednesday, March 21, 2012

Help on 2 Issues

I start SQL with startup parameters -eD:\MSSQL\Log\ERRORLog to put all
general SQL server logs here.
We experienced an error this morning, log entries follow;
2005-10-13 09:12:55.50 spid75 Open of fault log
E:\MSSQL\log\exception.log failed.
2005-10-13 09:12:55.54 spid75 Using 'dbghelp.dll' version '4.0.5'
2005-10-13 09:12:55.56 spid75 Error: 0, Severity: 19, State: 0
2005-10-13 09:12:55.56 spid75 SqlDumpExceptionHandler: Process 75
generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is
terminating this process..
One, any idea what this error could be casued by ... and two, noticed it is
trying to writte teh exception.log to E:\MSSQL\log which (the folder) did
not exist. Shouldn't it be writing to where the rest of the logs go? Is
the -e startup parameter configured wrong?
Also, yesterday during the middle of the day we lost the ability for domain
users to log in. Anyone with an exisitng login was fine. Any users using SQL
server logins were fine, but any domain users that needed to connect could
not.
We were getting the following error.
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
'(null)'. Reason: Not associated with a trusted SQL Server connection.
[Microsoft][ODBC SQL Server Driver]Invalid connection string attribute
A restart of SQL service cleared up the issue, but any idea why this could
happen?
Any assistance is greatly appreciated.Hi
I assume that there is no exception.log in D:\MSSQL\Log\ERRORLog and the
message is incorrect?
You may want to contact PSS regarding this and possibly try running SQLdiag
during the day. Check the windows event log to see if there are any other
messages around this time, you lack of connectivity for windows
authentication may imply your network has a problem.
John
"Mike" wrote:
> I start SQL with startup parameters -eD:\MSSQL\Log\ERRORLog to put all
> general SQL server logs here.
> We experienced an error this morning, log entries follow;
> 2005-10-13 09:12:55.50 spid75 Open of fault log
> E:\MSSQL\log\exception.log failed.
> 2005-10-13 09:12:55.54 spid75 Using 'dbghelp.dll' version '4.0.5'
> 2005-10-13 09:12:55.56 spid75 Error: 0, Severity: 19, State: 0
> 2005-10-13 09:12:55.56 spid75 SqlDumpExceptionHandler: Process 75
> generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is
> terminating this process..
> One, any idea what this error could be casued by ... and two, noticed it is
> trying to writte teh exception.log to E:\MSSQL\log which (the folder) did
> not exist. Shouldn't it be writing to where the rest of the logs go? Is
> the -e startup parameter configured wrong?
> Also, yesterday during the middle of the day we lost the ability for domain
> users to log in. Anyone with an exisitng login was fine. Any users using SQL
> server logins were fine, but any domain users that needed to connect could
> not.
> We were getting the following error.
> [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
> '(null)'. Reason: Not associated with a trusted SQL Server connection.
> [Microsoft][ODBC SQL Server Driver]Invalid connection string attribute
> A restart of SQL service cleared up the issue, but any idea why this could
> happen?
> Any assistance is greatly appreciated.
>
>sql

Help on 2 Issues

I start SQL with startup parameters -eD:\MSSQL\Log\ERRORLog to put all
general SQL server logs here.
We experienced an error this morning, log entries follow;
2005-10-13 09:12:55.50 spid75 Open of fault log
E:\MSSQL\log\exception.log failed.
2005-10-13 09:12:55.54 spid75 Using 'dbghelp.dll' version '4.0.5'
2005-10-13 09:12:55.56 spid75 Error: 0, Severity: 19, State: 0
2005-10-13 09:12:55.56 spid75 SqlDumpExceptionHandler: Process 75
generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is
terminating this process..
One, any idea what this error could be casued by ... and two, noticed it is
trying to writte teh exception.log to E:\MSSQL\log which (the folder) did
not exist. Shouldn't it be writing to where the rest of the logs go? Is
the -e startup parameter configured wrong?
Also, yesterday during the middle of the day we lost the ability for domain
users to log in. Anyone with an exisitng login was fine. Any users using SQL
server logins were fine, but any domain users that needed to connect could
not.
We were getting the following error.
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for
user
'(null)'. Reason: Not associated with a trusted SQL Server connection.
[Microsoft][ODBC SQL Server Driver]Invalid connection string attribu
te
A restart of SQL service cleared up the issue, but any idea why this could
happen?
Any assistance is greatly appreciated.Hi
I assume that there is no exception.log in D:\MSSQL\Log\ERRORLog and the
message is incorrect?
You may want to contact PSS regarding this and possibly try running SQLdiag
during the day. Check the windows event log to see if there are any other
messages around this time, you lack of connectivity for windows
authentication may imply your network has a problem.
John
"Mike" wrote:

> I start SQL with startup parameters -eD:\MSSQL\Log\ERRORLog to put all
> general SQL server logs here.
> We experienced an error this morning, log entries follow;
> 2005-10-13 09:12:55.50 spid75 Open of fault log
> E:\MSSQL\log\exception.log failed.
> 2005-10-13 09:12:55.54 spid75 Using 'dbghelp.dll' version '4.0.5'
> 2005-10-13 09:12:55.56 spid75 Error: 0, Severity: 19, State: 0
> 2005-10-13 09:12:55.56 spid75 SqlDumpExceptionHandler: Process 75
> generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server
is
> terminating this process..
> One, any idea what this error could be casued by ... and two, noticed it i
s
> trying to writte teh exception.log to E:\MSSQL\log which (the folder) did
> not exist. Shouldn't it be writing to where the rest of the logs go? Is
> the -e startup parameter configured wrong?
> Also, yesterday during the middle of the day we lost the ability for domai
n
> users to log in. Anyone with an exisitng login was fine. Any users using S
QL
> server logins were fine, but any domain users that needed to connect could
> not.
> We were getting the following error.
> [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed fo
r user
> '(null)'. Reason: Not associated with a trusted SQL Server connection.
> [Microsoft][ODBC SQL Server Driver]Invalid connection string attri
bute
> A restart of SQL service cleared up the issue, but any idea why this could
> happen?
> Any assistance is greatly appreciated.
>
>

Help on 2 Issues

I start SQL with startup parameters -eD:\MSSQL\Log\ERRORLog to put all
general SQL server logs here.
We experienced an error this morning, log entries follow;
2005-10-13 09:12:55.50 spid75 Open of fault log
E:\MSSQL\log\exception.log failed.
2005-10-13 09:12:55.54 spid75 Using 'dbghelp.dll' version '4.0.5'
2005-10-13 09:12:55.56 spid75 Error: 0, Severity: 19, State: 0
2005-10-13 09:12:55.56 spid75 SqlDumpExceptionHandler: Process 75
generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is
terminating this process..
One, any idea what this error could be casued by ... and two, noticed it is
trying to writte teh exception.log to E:\MSSQL\log which (the folder) did
not exist. Shouldn't it be writing to where the rest of the logs go? Is
the -e startup parameter configured wrong?
Also, yesterday during the middle of the day we lost the ability for domain
users to log in. Anyone with an exisitng login was fine. Any users using SQL
server logins were fine, but any domain users that needed to connect could
not.
We were getting the following error.
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
'(null)'. Reason: Not associated with a trusted SQL Server connection.
[Microsoft][ODBC SQL Server Driver]Invalid connection string attribute
A restart of SQL service cleared up the issue, but any idea why this could
happen?
Any assistance is greatly appreciated.
Hi
I assume that there is no exception.log in D:\MSSQL\Log\ERRORLog and the
message is incorrect?
You may want to contact PSS regarding this and possibly try running SQLdiag
during the day. Check the windows event log to see if there are any other
messages around this time, you lack of connectivity for windows
authentication may imply your network has a problem.
John
"Mike" wrote:

> I start SQL with startup parameters -eD:\MSSQL\Log\ERRORLog to put all
> general SQL server logs here.
> We experienced an error this morning, log entries follow;
> 2005-10-13 09:12:55.50 spid75 Open of fault log
> E:\MSSQL\log\exception.log failed.
> 2005-10-13 09:12:55.54 spid75 Using 'dbghelp.dll' version '4.0.5'
> 2005-10-13 09:12:55.56 spid75 Error: 0, Severity: 19, State: 0
> 2005-10-13 09:12:55.56 spid75 SqlDumpExceptionHandler: Process 75
> generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is
> terminating this process..
> One, any idea what this error could be casued by ... and two, noticed it is
> trying to writte teh exception.log to E:\MSSQL\log which (the folder) did
> not exist. Shouldn't it be writing to where the rest of the logs go? Is
> the -e startup parameter configured wrong?
> Also, yesterday during the middle of the day we lost the ability for domain
> users to log in. Anyone with an exisitng login was fine. Any users using SQL
> server logins were fine, but any domain users that needed to connect could
> not.
> We were getting the following error.
> [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
> '(null)'. Reason: Not associated with a trusted SQL Server connection.
> [Microsoft][ODBC SQL Server Driver]Invalid connection string attribute
> A restart of SQL service cleared up the issue, but any idea why this could
> happen?
> Any assistance is greatly appreciated.
>
>

Friday, March 9, 2012

Help Needed For reporting service 2005(Rendering in PDF)

Hi experts
I am working on sql server reporting services 2005.
Now a days i m developing a text report. Which shows text for selected
parameters.
I have added more table headers in my layout. And i am using one row
for heading and just below row for description.
This description is comming from database so it is variable, somtimes
it is having ony 100 chars and some times it is
having more than 20000 chars. Problem starts here when the number of
charcters are less then report is looking good in PDF
But when it is more then the description row moves on next page. I
have tried this by selecting the table property "Fit table in one page
if possible"
I have once cheked this property and once unchecked this but result is
same. Report looks good in report viewer but not looks good in PDF
format.
MY another question is it possible that i can bind two rows in the
table that if second rows goes in the second page then
the row above also goes on next page. RIght now heading row appears on
first page in pdf and then second row starts on new page after leaving
all the available space on first page.
So please if any body have any idea about my problem, Please help me.
Any help will be gratefull.
Regards
DineshTry to use group.
"Dinesh" wrote:
> Hi experts
> I am working on sql server reporting services 2005.
> Now a days i m developing a text report. Which shows text for selected
> parameters.
> I have added more table headers in my layout. And i am using one row
> for heading and just below row for description.
> This description is comming from database so it is variable, somtimes
> it is having ony 100 chars and some times it is
> having more than 20000 chars. Problem starts here when the number of
> charcters are less then report is looking good in PDF
> But when it is more then the description row moves on next page. I
> have tried this by selecting the table property "Fit table in one page
> if possible"
> I have once cheked this property and once unchecked this but result is
> same. Report looks good in report viewer but not looks good in PDF
> format.
> MY another question is it possible that i can bind two rows in the
> table that if second rows goes in the second page then
> the row above also goes on next page. RIght now heading row appears on
> first page in pdf and then second row starts on new page after leaving
> all the available space on first page.
> So please if any body have any idea about my problem, Please help me.
> Any help will be gratefull.
> Regards
> Dinesh
>

Monday, February 27, 2012

Help Me! How can I use SQL Server Subreports in Visual Web Developer Express Edition

Hi,

I use Visual Web Developer 2005 Express Edition. Anybody help me how can i use reports and subreports with parameters in it. I am new to ASP.NET. Please give me a sample. Thanks in advance.

Take a look at this article "Adding a Subreport with Parameters", it might be able to help you.

http://msdn2.microsoft.com/en-US/library/aa337490.aspx

Hope this helps.

Jarret

Help me with SP OrderBy

I have a SP that accepts parameters, but the problem is that it is not ORDERING Data as required, It is returning ORDER BY NULL instead of order by my parameter "NAME "here is the output from SQL 2000 DB

'ELP B4 I jump out of LondonBridge

**********************************
SELECT * FROM #TempTable WHERE ID > 0 AND ID < 6 AND EmployerID = 54 AND Job_no = 40

ORDER BY NULL
****************************************


SELECT @.MYSTATEMENT = ' SELECT * FROM #TempTable

WHERE
ID > '+ convert(varchar(20),@.FirstRec) +'
AND
ID < '+convert(varchar(20),@.LastRec) +'
AND EmployerID = '+ convert(varchar(20),@.EmployerID)+'
AND Job_no = '+convert(varchar(20),@.Job_no)+'

ORDER BY ' +
CASE WHEN @.WhichColumn= 'name' AND @.sortby= 'asc'
THEN 'name'
ELSE 'NULL'
END
+
CASE WHEN @.WhichColumn='name' AND @.sortby='DESC'
THEN ' desc'
ELSE ''
END

EXEC (@.myStatement)

try :

ORDER BY ' +
CASE WHEN @.WhichColumn= 'name' AND @.sortby= 'asc' THEN 'name ASC'
WHEN @.WhichColumn = 'name' AND @.sortby = 'desc' THEN 'name desc'
ELSE 'NULL'
END

also do a print @.myStatement before you execute the statement to see how its building up.

hth|||Hi this is the output, it is still showing null

SELECT * FROM #TempTable

WHERE
ID > 0
AND
ID < 6
AND EmployerID = 54
AND Job_no = 40

ORDER BY NULL

(5 row(s) affected)|||what value are you passing to the parameter @.WhichColumn ?|||I have done a print on @.whichColumn, it is giving me the right value which is 'NAME'
So the problem must be from the case statement, but I can't figure it out

Thanks|||


declare @.MYSTATEMENT varchar(500), @.WhichColumn varchar(100), @.sortby varchar(100)
set @.sortby = 'desc'
set @.WhichColumn = 'name'
SELECT @.MYSTATEMENT = ' SELECT * FROM #TempTable WHERE ID > 6 AND ID < 10 ORDER BY ' +

CASE WHEN @.WhichColumn= 'name' AND @.sortby= 'asc' THEN 'name ASC'
WHEN @.WhichColumn = 'name' AND @.sortby = 'desc' THEN 'name desc'
ELSE 'NULL'
END

print @.mystatement

i just did this in my QA and it worked fine for me. so double check your code.

hth