T-SQL (SS2K8) :: Can Value Of Parameters Passed To A Query Be Determined In Profiler
Mar 27, 2014
In Profiler a StmtCompleted Event Class has identified a query to be:
SELECT TOP 1 * FROM [WINSVR2008R2].[001].DBO.[OECTLFIL_SQL] WHERE ( ( OE_CTL_KEY_1 = @P1 ) ) order by OE_CTL_KEY_1 asc
Is there any way to determine the value of @P1? If so which Event class and Column should I examine?
View 5 Replies
ADVERTISEMENT
Sep 29, 2015
So I have a report that uses an MDX query to fetch the main data for the tablix. Then I have a custom row added which pulls data in via a Lookup function and references a different dataset. The report has 3 parameters. Each dataset uses those 3 parameters in its underlying query. However, the dataset referenced in the lookup function doesnt seem to be updating when change the parameters and re-run the report.
View 2 Replies
View Related
Mar 13, 2014
I am using the following code in my query to fetch data for my ssrs report which have a parameter @auditCode, where multiple auditCodes can be inputted to generate the report.
Is there any other way I can achieve the same functionality avoiding the part charindex(LU.auditCode,@auditCode)<>0 , as it will return wrong results.
For instance, it will return, the results for the audit code ‘INPS45’ and ‘INPS450000’ when audit code ‘INPS45’ is inputted.
SELECT distinct Ac.activityCode,
Ac.ActivityName + isnull(Ac.description,'') AS ActivityName,
Ac.activityStartDate, Ac.activityEndDate,
LU.auditCode,
LU.AuditName,
St.studyCode AS StudyCode,
St.StudyName AS StudyName
[Code] ....
View 3 Replies
View Related
May 14, 2014
I'd like to be able to offer the option of selecting a project by the ProjectID number, and if a projectID is not supplied then the default result set would be select * from tbl_Projects.
ALTER PROCEDURE [USP_SelectProject]
-- Add the parameters for the stored procedure here
@ProjectNumber as int
AS
BEGIN
[code]....
View 9 Replies
View Related
Apr 14, 2004
I have a report in SQL that passes parameters at runtime entered by the user for two date ranges (beginning and ending). I'm trying to write a formula that will print a specific field *only if* the specified date range entered by the user is BETWEEN a specific value (like 200401). This is kind of reverse of a normal WHERE, BETWEEN clause.
I tried a standard BETWEEN predicate in my WHERE clause like:
IF '200401' BETWEEN ?BegPer and ?EndPer then salesanal.ptdbud01 else 0
But, it's returning an error that my Then statement is missing. I can't use a normal statement like 'IF ?BegPer >= '200401' and ?EndPer <= '200401', then.....' because users could enter a RANGE of periods, so it would be difficult to code all of the possible combinations this way. I'm actually doing this in Crystal, but if someone can give me a standard MSSQL example, I can translate that over to Crystal.
Thanks in advance,
Michelle
View 4 Replies
View Related
Aug 21, 2007
hello all, im trying to run a select statement using a parameter, but am having extreme difficulties. I have tried this about 50 different ways but i will only post the most recent cause i think that im the closest now than ever before ! i would love any help i can get !!!
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim pageID As StringpageID = Request.QueryString("ID")
TextBox13.Text = pageID 'Test to make sure the value was stored
SqlDataSource1.SelectParameters.Add("@pageID", pageID)
End Sub
....
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ProviderName=System.Data.SqlClient ConnectionString="Data Source=.SQLEXPRESS;Initial Catalog=software;Integrated Security=True;User=something;Password=something" 'SelectCommand="SELECT * FROM Table1 WHERE [ClientID]='@pageID' ></asp:SqlDataSource>
The error that i am getting, regardless of what i put inside the ' ' is as follows:
"Conversion failed when converting the varchar value '@pageID' to data type int."
anyone have any suggestions ?
View 2 Replies
View Related
Jul 23, 2005
I have an sql query that has specific criteria (like state='PA' orstate = 'NJ'...) and would like to be able to have the user specifythe criteria dynamically either through the web or from MSAccess oranother tool.The query also does a GROUP BY the state and other variables that arepart of the criteria.I know how to get MSAccess and asp pages to do the sorting andselecting against an SQL tbl or view, but when access queries the sameinfo as the original sql view, the process takes much longer than whenthe sql view does all of the sorting, selecting and grouping..The table we are currently using is 5 million records and will begrowing to 250 million records shortly, so speed is of the essence.The sql views and MSAccess are both running from the same server sothere is no issue at this point of a network impacting the MSAccessquery.Any suggestions...
View 6 Replies
View Related
Jul 23, 2005
In which system table the information about the optional parameters passed to stored procedure are stored.I know about the tbl_columns and all that stuff. From where can i can come to know the parameter is mandatory or optional.--Message posted via http://www.sqlmonster.com
View 1 Replies
View Related
Jan 8, 2007
Hi,
I am having the "classical problem" of the forums; A local date changed to the american format (normally in the development environment) which I call "Switching months with days"... well it switches both again if you press "view report" again :)The problem I'm having is that when I Navigate from one report to other, the dates get switched... Everything's been set in the locale uk date format (dd/mm/aaaa), in the operating system, in the database and in the reports... and the reports are working properly through the web interface.. the only thing that is not working properly is the Navigation which switches the date month with the day...Changing all the Reporting Services server, database server to the american format date is not an acceptable solution. Thanks for any guidance on this, as I'm pretty lost...Jose
View 4 Replies
View Related
Sep 1, 2014
I have the following code and i want to passed more than one value:
DECLARE @myvendedor AS varchar(255)
SET @myvendedor = '87,30'
print @myvendedor
SELECT top 10 ECOM.COM1,* from ecom (nolock) WHERE ecom.PORVEND=1 AND ECOM.VENDEDOR IN (@myvendedor)
Table Field ECOM.VENDEDOR is Numeric(4,0)
This error occur:
87,30 --Result of PRINT
Msg 8114, Level 16, State 5, Line 6
Error converting data type varchar to numeric.
I change :
DECLARE @myvendedor AS numeric(4,0)
and this error appear:
Msg 8114, Level 16, State 5, Line 2
Error converting data type varchar to numeric.
View 9 Replies
View Related
Apr 13, 2007
Hi, all experts here,
Thank you very much for your kind attention.
I am having a question about how can I put a chart and a table in a same page of my report? And let the same parameters passed between them? Is it possible in SQL server 2005 Reporting Services? Please would any experts here shed me any light on it?
Thank you very much in advance and I am looking forward to hearing from you.
With best regards,
Yours sincerely,
View 3 Replies
View Related
Nov 21, 2007
Hi,I'm using c# with a tableadapter to call stored procedures. I'm running into a problem where if I have over a certain byte size or number of parameters being passed into my stored proc I get an exception that reads: "Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized." If I remove one parameter, the problem goes away. Has anyone run into this before? Thanks,Mark
View 3 Replies
View Related
Jun 23, 2015
Using the following:
SQL Server: SQL Server 2012
Visual Studio 2012
I have created an SSIS package where I have added an Execute SQL Task to run an existing stored procedure in my SQL database.
General Tab:
Result Set: None
Connection Type: OLE DB
SourceType: Direct Input
IsQueryStoredProcedure: False (this is greyed out and cannot be changed)
Bypass Prepare: True
SQL Statement: EXEC FL_CUSTOM_sp_ml_location_load ?, ?;
Parameter Mapping:
Variable Name Direction Data Type Prmtr Name Prmtr Size
User: system_cd Input NVARCHAR 0 10
User: location_type_cd Input NVARCHAR 1 10
Variables:
location_type_cd - Data type - string; Value - Store (this is static)
system_cd - Data type - string - ??????
The system code changes based on the system field for each record in the load table
Sample Data:
SysStr # Str_Nm
3 7421Store1
3 7454Store2
1815061Store3
1815063Store4
1615064Store5
1615065Store6
1615066Store7
7725155Store8
STORED PROCEDURE: The stored procedure takes data from a load table and inserts it into another table:
Stored procedure variables:
ALTER PROCEDURE [dbo].[sp_ml_location_load]
(@system_cd nvarchar(10), @location_type_cd nvarchar(10))
AS
BEGIN .....................
This is an example of what I want to accomplish: I need to be able to group all system 3 records, then pass 3 as the parameter for system_cd, run the stored procedure for those records, then group all system 18 records, then pass 18 as the parameter for system_cd, run the stored procedure for those records and keep doing this for each different system in the table until all records are processed.
I am not sure how or if it can be done to pass the system parameter to the stored procedure based on the system # in the sys field of the data.
View 6 Replies
View Related
Apr 15, 2008
I have an issue with using multiple parameters in SQL Reporting services where data is passed in from a stored procedure
When running the report in design mode - I can type in a parameter sting and it runs fine
In the report preview screen I can select single parameters by ticking the drop down list and again it runs fine
as soon as I tick more than one I get an error
An error occurred during local report processing
Query execution failed for data set €˜data'
Must declare the scalar variable '@parameter'
Some info...
The dataset 'workshop' is using a sproc to return the data string?
I get multiple values back fine in the sproc using this piece of code
(select [str] from iter_charlist_to_table( @Parameter, DEFAULT) ))
I have report parameters set to Multi-Value
Looking through the online books it says...
You can define a multivalued parameter for any report parameter that you create.
However, if you want to pass multiple parameter values back to a query, the following requirements must be satisfied:
The data source must be SQL Server, Oracle, or Analysis Services.
The data source cannot be a stored procedure. Reporting Services does not support passing a multivalued parameter array to a stored procedure.
The query must use an IN clause to specify the parameter.
Am I trying to do the impossible ?
View 1 Replies
View Related
Jul 15, 2014
I am writing a stored procedure that takes in a customer number, a current (most recent) sales order quote, a prior (to most current) sales order quote, a current item 1, and a prior item 1, all of these parameters are required.Then I have current item 2, prior item 2, current item 3, prior item 3, which are optional.
I added an IF to check for the value of current item 2, prior item 2, current item 3, prior item 3, if there are values, then variable tables are created and filled with data, then are retrieved. As it is, my stored procedure returns 3 sets of data when current item 1, prior item 1, current item 2, prior item 2, current item 3, prior item 3 are passed to it, and only one if 2, and 3 are omitted.I would like to learn how can I return this as a one data set, either using a full outer join, or a union all?I am including a copy of my stored procedure as it is.
View 6 Replies
View Related
Aug 8, 2006
I have been attempting to build a search engine that searches a database full of invoices. The user will enter in a invoice number and then the results will be returned if the exact invoice exists and if the record belongs to the user.
My first attempt has involved the use of a SQL Datasource to pass a stored procedure based on what is in the search textbox and the information in the cookie about the user. I was hoping that on the btnsearch.click event that I could somehow return the stored procedure in the SQL DataSource. My next step was to make the result (if exists) part of the query string like this:
Response.Redirect("~/Invoice.aspx?Invoice=?"+ SQLRETURNEDVALUE)
I'm looking for any help to a possible way to use my idea or any other ideas to get a invoice number and place it into a query string so that the result can be fetched on the next page. Thanks
View 4 Replies
View Related
Jul 23, 2005
I am new to sql and very familiar with access. I am using a verylarge database(130M records) in ms sql2000 and think I need to frontend it with access for reports and forms, etc..I have some questions:1) Is there a way in SQL to prompt a user for input at the running ofa query like the [what is your name] construct in an access query?2) I can't seem to create calculated fields in a view in sql. Inaccess I put "total:=hours*rate" and a new column would be createdwhich would contain the total.3) I normally would create a form in access from which the accessqueries would pull their variables and then insert those variables inthe queries or reports, etc. How would this be accomplished usingsql.4) Lastly and probably most basic. How does a "real" sql developercreate reports and forms to interact with the enduser? I am usingaccess as a front end, but am open to suggestions.Thanks,Brad
View 1 Replies
View Related
May 2, 2008
i want to select the values of column passed from the user like
connectionsizein or connectionsizemm
how can i do
i am using sql server 2005
View 2 Replies
View Related
Nov 16, 2004
I am not sure about the architecture of the Issue Tracker and hence not sure if it applies here. But I will post in any case and wait for users on this forums comments as well.
===========Earlier post==================
This question is regarding the architecture of TimeEntry.
In some programs it builds an arrayList for Master-detail type of relationship and when user is ready to save it by clicking 'submit' it build a variable with pipe delimited fields.
This is then passed to a sql query.
This to me does not seem to be an efficient manner. Because the max character is 1500 chars as parameter to SQL query.
I was wondering if instead I could store it as an XML and then use the XML to import in to SQL.
Any ideas is greatly appreciated, I am running in to problems where my variable construct does increase to more than 1500 chars. Any thoughts are much appreciated in this regards.
Regards,
MillenniumIte.
View 2 Replies
View Related
Nov 28, 2005
Hi
i got errro mess "Invalid length parameter passed to the substring function" from this below. Anyone how can give me a hint what cause this, and how i can solve it? if i remove whats whitin thoose [] it works, i dont use [] in the code :)
colums:
VLF_InfectionDestination is nvarchar 254
SELECT TOP 10 tb_AVVirusLog.VLF_VirusName, COUNT(tb_AVVirusLog.VLF_VirusName) AS number
FROM tb_AVVirusLog INNER JOIN
__CustomerMachines002 ON tb_AVVirusLog.CLF_ComputerName = __CustomerMachines002.FalseName
WHERE (CONVERT(varchar, tb_AVVirusLog.CLF_LogGenerationTime, 120) BETWEEN @fyear + @fmonth + @fday AND @tyear + @tmonth + @tday) AND
(__CustomerMachines002.folder_id = @folderId) [OR
(CONVERT(varchar, tb_AVVirusLog.CLF_LogGenerationTime, 120) BETWEEN @fyear + @fmonth + @fday AND @tyear + @tmonth + @tday) AND
(tb_AVVirusLog.VLF_InfectionDestination LIKE N'%@%')]
GROUP BY tb_AVVirusLog.VLF_VirusName
HAVING (NOT (tb_AVVirusLog.VLF_VirusName LIKE N'cookie'))
ORDER BY COUNT(tb_AVVirusLog.VLF_VirusName) DESC
View 7 Replies
View Related
Apr 4, 2007
Hello - I am using report builder against models.
Which attributes or properties determine what is shown when you do click/drill into the details? I'm using the adventure works database as my guide and expected the (default,Identifying or Aggregate ) attributes to control it, can you summarize how the drill details are determined? My test from adventure works sample:
Pull Territory Name and #customers into the report
Run it and drill into the details on one of the #customers
It returns Acct#, CustType, CustName, #SalesOrders, Sum of a bunch of sales order fields and # customer addresses.
The first three are the default attributes for a customer and the last sets look to be the default aggregates for the other relations to customer - Sales Order & Address.
Is it safe to say that it pulls in the default attributes of the immediate child and then aggregates of it's children? Does it go recursively?
Thanks in advance,
Toni
View 1 Replies
View Related
Feb 1, 2007
Hi, I am sending a message to an invalid target name. The message eventually gets back to the initiator as an error type message. How can I determine the exact cause of the error - and determine that the target service name is invalid? I am using the ServiceBrokerInterface and the Message does not tell much - it seems. Also, in the sys.conversation_endpoints table, the record associated to the message only says 'Error', but no other indicator.
View 3 Replies
View Related
Jun 5, 2007
Hi, people! I'm a Brazilian and forgive me for my poor English...
I have a stored procedure in SQL Server 2000 with return me the follow data:
REGION | TYPE | VALUE_TOT
Reg 1 | TP 1 | 10
Reg 1 | TP 2 | 15
Reg 1 | TP 3 | 20
Reg 2 | TP 1 | 8
Reg 2 | TP 2 | 27
Reg 2 | TP 3 | 11
Reg 3 | TP 1 | 3
Reg 3 | TP 2 | 6
Reg 3 | TP 3 | 50
In the Reporting Services I make a grouping for REGION AND TYPE, and return me this:
REGION TYPE VALUE_TOT
Reg 1
TP 1 10
TP 2 15
TP 3 20
Reg 2
TP 1 8
TP 2 27
TP 3 11
I need place a new column in the right and a value only in the line where TYPE = TP 2. The value is: (VALUE_TOT in TP 2 * 100) / VALUE_TOT in TP 1.
It would be something thus:
REGION TYPE VALUE_TOT CALC
TP 1 10
TP 2 15 150
TP 3 20
Reg 2
TP 1 8
TP 2 27 337,5
TP 3 11
This is detail line, as would make this calculation? How it would capture the value of TP 1 and TP 2? Row number? Somebody has some idea?
Thanks! The MSDN in my language is little, have only 200 posts...
View 5 Replies
View Related
Mar 19, 2007
I'm using the sample on custom authentication from msdn but whenever I try to login I get this message.What URI are they complaining about? Has it anything to do with the custom cookie handling? I cant for the world understand whats wrong.
View 11 Replies
View Related
Apr 16, 2014
I have to create a report and I want all activity for the previous month.
I need to calculate the First and Last Day Prior Month to be used as Input Parameters.
Would something like this be the case or is there a better solution?
[code="sql"]
SELECT DATEADD(month, DATEDIFF(month, -1, getdate()) - 2, 0) as FirstDayPreviousMonthWithTimeStamp,
DATEADD(ss, -1, DATEADD(month, DATEDIFF(month, 0, getdate()), 0)) as LastDayPreviousMonthWithTimeStamp
[/code]
I was thinking get the first day of the previous and current month to exclude the Timestamp and use a less then first day of current month?
View 3 Replies
View Related
Apr 16, 2014
In t-sql 2008 r2 I need execute a stored procedure called StudentData and pass 3 parameter values to the stored procedure. The stored procedure will then return 5 values that are needed for the main sql. My problem is I do not know how to have the t-sql call the stored procedure with the 3 parameter values and pass back the 5 different unique data values that I am looking for.
The basic dataset is the following:
SELECT SchoolNumber,
SchoolName,
StudentNumber,
from [Trans].[dbo].[Student]
order by SchoolNumber,
SchoolName,
StudentNumber
I basically want to pass the 3 parameters of SchoolNumber, SchoolName, and StudentNumber to the stored procedure called StudentData from the data I obtain from the [Trans].[dbo].[Student]. The 3 parameter values will be obtained from the sql listed above.
The columns that I need from the stored procedure called StudentData will return the following data columns
that I need for the report: StudnentName, StudentAddress, Studentbirthdate, StudentPhoneNumber, GuardianName.
Thus can you show me how to setup the sql to meet this requirement I have?
View 2 Replies
View Related
Mar 22, 2006
Hi ,
I have query executed 1000 times a day by application with diffrent values in where ... but profiler shows different duration each time
duration might be 100 milisecond ,but might be 140000 miliseconds !!!
what is a reason ? should I belive profiler ?
SELECT cust_calls.call_date , cust_calls.work_order_sap , cust_calls.call_type_code , cust_calls.call_status , cust_calls.ind_max_expense , cust_calls.chng_date , cust_calls.user_id , cust_calls.call_seq_no , cust_calls.loc_equip_seq_no , cust_calls.initial FROM cust_calls WHERE (
cust_calls.loc_equip_seq_no = 3780 ) --changes with each query
ORDER BY cust_calls.call_date DESC
execution plan
|--Index Seek(OBJECT ([price].[dbo].[cust_calls].[cust_calls2]), SEEK ([cust_calls].[loc_equip_seq_no]=Convert([@1])) ORDERED FORWARD)
--space used--
name rows reserved data index_size unused
cust_calls 205019 201544 KB 74776 KB 38256 KB 88512 KB
-- table structure
CREATE TABLE [cust_calls] (
[call_seq_no] [numeric](7, 0) NOT NULL ,
[manufacturer_code] [char] (6) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[in_charge_code] [char] (6) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[work_order_sap] [char] (7) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[loc_equip_seq_no] [numeric](7, 0) NOT NULL ,
[call_type_code] [char] (5) COLLATE SQL_Latin1_General_CP1_CI_AI NOT NULL ,
[syst_lang_code] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[maint_emp_code] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[expense_code] [char] (5) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[ind_max_expense] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[call_date] [datetime] NULL ,
[call_status] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[call_description] [text] COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[chng_date] [datetime] NOT NULL ,
[user_id] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AI NOT NULL ,
[Invoice_number] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[invoice_date] [datetime] NULL ,
[invoice_amount] [numeric](9, 2) NULL ,
[invoice_note] [text] COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[initial] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[call_date_update] [datetime] NULL ,
[call_logon_id_update] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[gl_code] [char] (6) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
[ind_follow_up] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AI NULL ,
CONSTRAINT [PK__cust_calls__4EF38B7F] PRIMARY KEY CLUSTERED
(
[call_seq_no]
) WITH FILLFACTOR = 90 ON [PRIMARY] ,
CONSTRAINT [FK__cust_calls__call___601E1781] FOREIGN KEY
(
[call_type_code]
) REFERENCES [cust_call_type] (
[call_type_code]
),
CONSTRAINT [FK__cust_calls__expen__267B85D1] FOREIGN KEY
(
[expense_code]
) REFERENCES [cust_expense] (
[expense_code]
),
CONSTRAINT [FK__cust_calls__in_ch__73BAFBDA] FOREIGN KEY
(
[in_charge_code]
) REFERENCES [cust_in_charge_warranty] (
[in_charge_code]
),
CONSTRAINT [FK__cust_calls__maint__40FA71E3] FOREIGN KEY
(
[maint_emp_code]
) REFERENCES [cust_maintenance_employees] (
[maint_emp_code]
),
CONSTRAINT [FK__cust_calls__manuf__41EE961C] FOREIGN KEY
(
[manufacturer_code]
) REFERENCES [cust_manufacturer] (
[manufacturer_code]
),
CONSTRAINT [FK__cust_calls__syst___1B29CEB6] FOREIGN KEY
(
[syst_lang_code]
) REFERENCES [cust_system_lang] (
[syst_lang_code]
),
CONSTRAINT [FK_cust_calls_cust_GL_Code_Type] FOREIGN KEY
(
[gl_code]
) REFERENCES [cust_GL_Code_Type] (
[gl_code]
)
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
View 10 Replies
View Related
Jul 23, 2005
Where is the information coming from that is displayed in queryprofiler.Is it the command that is retrieved before it is processed, or is itwhat is actually processed.
View 3 Replies
View Related
May 23, 2006
Hi,
A colleague and I have just found a slightly strange situation that we don't understand.
We had (effectively) the following query:
select cast(1 as decimal(38,10))
union all
select cast(1 as decimal(38,4))
And the result contained 2 rows, each with a a scale of 4. This surprised us, we expected that the metadata of the result would be determined by the topmost query.
So we reversed them and tried this:
select cast(1 as decimal(38,4))
union all
select cast(1 as decimal(38,10))
and got exactly the same result. 2 rows with a scale of 4.
We can't understand why the scale always gets determined to be 4 regardless of the order of the queries.
Any explanation would be much appreciated!
Thanks
Jamie
View 4 Replies
View Related
Jan 12, 2007
Hi everyone
Primary platform is 2005 on 64-bit.
I've got a couple of questions linked to partitionating tables.
-What sort of criteria follows Database Engine when you have two NDF assigned to one filegroup and this filegroup is part of partition
What's more: Could I force that Sql will use one by default?
I mean, my first partition encompass from 20020101 till 20030101. When I add data for example March or June, could I decide that these months belong to NDF1 rather than NDF2?
Let me know if you need further details.
Thanks in advance for your time,
View 4 Replies
View Related
Jun 2, 2014
I have various ways of getting the parameters of a stored procedure:
I have a procedure that has all defaults 4 are null and 2 are 0.
The following shows most of what I need but no defaults
SELECT PARAMETER_NAME ,
ORDINAL_POSITION ,
DATA_TYPE ,
CHARACTER_MAXIMUM_LENGTH ,
CHARACTER_OCTET_LENGTH ,
NUMERIC_PRECISION ,
[Code] ...
This one has two values:
PARAMETER_HASDEFAULT (always 0) and PARAMETER_DEFAULT (always 0)
sp_procedure_params_rowset proc procedure
Is there something else that would tell me if there is a default on a parameter and what the default is if there is one.
View 2 Replies
View Related
Dec 1, 2014
Using a full search index with the following query works with just one parameter.
declare @P0 varchar(50) = '"First*"'
SELECT *
FROM TableName
where contains ((Col1, Col2), @P0)
How do I make it work if I have two parameters, while also protecting the parameters from injection attacks?
declare @P0 varchar(50) = '"First*"'
declare @P1 varchar(50) = '"Second*"'
SELECT *
FROM TableName
where contains ((Col1, Col2), @P0 AND @P1)
If there weren't parameters, you put single quotes around the '@P0 AND @P1' to get this query to work.
In addition, while "where contains((Col1,Col2),@P0) and contains((Col1,Col2),@P1)" works, it appears to increase the execution time.
View 0 Replies
View Related
Feb 16, 2004
I am looking for a way to log all events that occur on the server. I have used quary profier and that gets me the info i need but is there a way to truncate the file, say only log the last 30 minutes of activity and having it rolling so that it is always the last 30 minutes. Or is there some other software that will do this. The database times out at random times and I am trying to fix the problem but dont want to keep houndreds of log files that query profiler will create by leaving a trace running 24/7. Any suggestions.
Thanks
Mark
View 5 Replies
View Related