Viewing Sql String Passed Into Sql Server
Mar 8, 2004
I have a stored proc that has several parameters. (using SQL server)
i call this proc and add the parameters etc and execute it etc
the problem is that how can i see the string that is being passed to the db? eg the calling command?
cheers
View 2 Replies
ADVERTISEMENT
Apr 16, 2008
Since SSIS is developed in Visual Studio is there a way to view the variable values as they are passed into SSIS? In Visual Studio I know if you hover over the variable a popup appears with the value in the variable.
I am having an issue with a variable value that is supplied through an "Execute SQL Task" it is a Directory path that is entered in through the application and used to determine where to pick up files to transfer. I have entered in the path using Fully Qualified(D:ImportExportCentralPrinting) and UNC (\SQLDEVELOPImportExportCentralPrinting) through both methods SSIS is telling me no files are available in the directory path. When I know for fact they do exists.
I would really love to see the variable values that are being used can anyone out there help?
Thank you all,
Mike
Michael Alawneh, DBA
View 3 Replies
View Related
Sep 26, 2014
Using a string of IDs passed into a stored procedure as a VARCHAR parameter ('1,2,100,1020,') in an IN without parsing the list to a temp table or table variable. Here's the situation, I've got a stored procedure that is called all the time. It's working with some larger tables (100+ Million rows). The procedure passes in as one of the variables a list of IDs for the large table. This list can have anywhere from 1 to ~100 IDs passed to it.
Currently, we are using a function to parse the list of IDs into a temp table then joining the temp table to get the query:
CREATE PROCEDURE [dbo].[GetStuff] (
@IdList varchar(max)
)
AS
SET NOCOUNT ON
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
[Code] .....
The problem we're running into is that since this proc gets called so often, we sometimes run into tempDB contention that slows this down. In my testing (unfortunately I don't have a good way of generating a production load) swapping the #table for an @table didn't make any difference which makes sense to me given that they are both allocated in the tempDB. One approach that I tried was that since the SELECT query is pretty simple, I moved it to dynamic SQL:
CREATE PROCEDURE [dbo].[GetStuff] (
@IdList varchar(max)
)
AS
SET NOCOUNT ON
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
[Code] ....
The problem I had there, is that it creates an Ad Hoc plan for the query and only reuses it if the same list of parameters are passed in, so I get a higher CPU cost because it compiles a plan and it also causes the plan cache to bloat since the parameter list is almost always different. Is there an approach that I haven't considered that may get the best of both worlds, avoiding or minimizing tempDB contention but also not having to compile a new plan every time the proc is run?
View 9 Replies
View Related
Nov 30, 2007
I have a requirement where, I need to get the value of parameter from a query string of url and use it in my report.
Ex:- http://www.mysite.com?name=bobby
From the above url, I have to take the value of name and be able to use it in my report query or assign to a parameter.
Please let me know, how can I acheive this.
View 1 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 22, 2015
when I am trying to perform below query,
INSERT INTO EMPLOYEE
SELECT TOP 100 *
FROM EMPLOYEE_LANDING;
I am getting Invalid length parameter passed to the LEFT or SUBSTRING function.
View 3 Replies
View Related
Nov 14, 2007
Hi, I test the following sql statement, finding that an error ocurs:
Msg 7630, Level 15, State 2, Line 3
Syntax error near '"' in the full-text search condition '"dsg SDRGDG " OR "sdfsdfsdfsdafdsafdsfds'.
DECLARE @searchTerm NVARCHAR(40)
SET @searchTerm = '"dsg SDRGDG " OR "sdfsdfsdfsdafdsafdsfdsafdsafdsafsafdfdsafdf"';
SELECT [JobTitle], [JobDes], [OpenDate], j.[URLRef], c.[CompanyName], c.[URLRef], c.[URLSource]
FROM JobWanted AS j INNER JOIN
Company AS c ON c.CompanyID = j.CompanyID
WHERE CONTAINS((JobTitle, JobDes), @searchTerm)
It seems too lengthy string will cause an error for full-text engine. I find the sdfsdfsdfsdafdsafdsfdsafdsafdsafsafdfdsafdf is truncated as shown in error message.
How to avoid this issue? Could I configre this limination?
Thanks in advance.
Ricky.
View 3 Replies
View Related
Sep 16, 2015
I am using sqljdbc41.jar to connect with MSSQL database, it is working fine on my local machine.Where as on the remote server, same class giving me error
Login failed for user '<domain><windows loginID>'
My connection string is URL...
I am using sqljdbc41.jar and on 64 bit processor , I am using following command which included path for sqljdbc_auth.dll java -Djava.library.path= C: sqljdbc_4.1enuauthx64 TestDao and error is Login failed for user '<domain><windows loginID>' why it is not picking up username passed in connection string. I have 2 machines, one is local and other is remote. on both machine I login using my domain, it is working absolutely fine on local then why the error is coming on remote machine.Both the machines are identical.
View 4 Replies
View Related
Jun 17, 2007
why can't i see SQL server 2005 the same way i see Visual Basic 2005 Express edition. i'm able to see VB by going under the all Programs menu and select it, when i try to find SQL 2005, i see configuration tools and some submenu of configuration tools. is that the way it is? if not, how do i get SQL 2005 to open up like VB so i can play with it. Also, at home i do not have a server, do i have to have a home server to play with SQL
hens
View 5 Replies
View Related
Aug 16, 2007
Hello,
I need to check if the IDs in table A on the server X exist in table B (if not check table C, if not in C, check table D ) on the server Y. The problem is that the table name changes every year and I need to use the variable for the reference table name in LookUp component in the Dataflow Task.
Can anyone help me?
View 1 Replies
View Related
Apr 22, 2015
I have a function that accepts a date parameter and uses getdate() as its default value. If a date is passed in, I'm going to have to find records using the datediff method based on input. If no date is passed, I am going to bypass the datediff logic and search for records based on a column called "is_current" which will reduce the query time.
However, I don't know how to tell if the date value in the function came from an input or was the default.
View 4 Replies
View Related
Oct 14, 2015
SQL Server 2008 R2. Visual Studio 2013.We have a third-party application that manages a SQL database. Within that application we can create queries (these are not SQL queries, but higher level queries made through a GUI). Although the user does not see the SQL code, the application nevertheless turns the query in SQL code and passes to SQL Server to retrieve the data requested. Is there a way using some SQL tool, some tool within the management studio, or some other method to capture the SQL code that is passed from the application to SQL Server?
View 7 Replies
View Related
Jan 13, 2007
This is a new problem to me, I have been running SQL Server 2000 with VS 2003 and last summer upgraded to SQL Server 2005 with VS 2005 - (both evaluation copies) all was fine
I bought the full upgrade of VS 2005 and SQL server dev edition in Dec 2006 and recently I have started to get a total system fallover dreadful noise followed by black screen and reboot.
This happens only when I view the Table Data "Show Table Data" in "Server Explorer" in VS2005, viewing design is OK, stored prcredures OK
I suspect this is either a hardware impending failure or software conflict but I would like some pointers please
I am using XP Pro sp2 with 1GB ram, F Secure Internet security, the Database is hosted externaly
View 5 Replies
View Related
Jan 23, 2007
Hello, we're having a bit of an issue getting Report Server to display reports. We've published via the web-interface and Visual Studio. After we publish, it gives an error and it looks as if it's trying to find the data source that we used to create the report. We've changed the datasource names to match that of the local machine too. Here's the error...
An error has occurred during report processing.
Cannot create a connection to data source 'LocalDataSourceName'.
Keyword not supported: 'driver'.
Any help would be greatly appreciated. Thank you!
View 3 Replies
View Related
Jun 2, 2008
Greetings,I have an e-timesheet application.i made a function that takes the startdate of the week:public SqlDataReader GetProjectsActive(DateTime SheetDate) { SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]); SqlCommand myCommand = new SqlCommand("GetProjectsActive", myConnection); myCommand.CommandType = CommandType.StoredProcedure; SqlParameter parameterSheetDate = new SqlParameter("@SheetDate", SqlDbType.DateTime); parameterSheetDate.Value = SheetDate; myCommand.Parameters.Add(parameterSheetDate); myConnection.Open(); SqlDataReader dr = myCommand.ExecuteReader(CommandBehavior.CloseConnection); return dr; } i run the application and i pass the value 6/1/2008 (date without time) to the GetProjectsActive but what i notice that the storedprocedure adds the current time to the passsed date when it has been executed so some projects will not appear since the startdate and enddate of the project are only dates so i try this solution: parameterSheetDate.Value = SheetDate.Date;and it works finebut my question why the current time has been added to the storedprocedure automatically although i pass only the date 6/1/2008 date????your help is highly appreciated.Best regards.
View 6 Replies
View Related
Jun 29, 2007
I have a project were I will have it so that users can sign in and change information on an SQL server. The catch is that this site will be from a different domain name and from a different hosting company then where the SQL database is located. Sorry if this is a dumb question but how can I utilize asp.net to change and view an SQL database that is located else-where.
For example: a user logs into www.something.com and he/she can view and edit SQL tables from www.somethingelse.com's database.
Thanks in advance.
View 2 Replies
View Related
Aug 9, 2000
Any idea on how I do this?
Any advice welcome.........
View 1 Replies
View Related
Aug 22, 2006
Hello,I'm trying to follow some sql sentences that my system send to SQL 2005express and I don't have a deep knowlegde of databases. I know thatthere's a transactions log that keeps all sentences that go intodatabase motor. Is it correct? in case yes, is there a way to look atthis archived sentences?Thanks in advanceIgnacio
View 1 Replies
View Related
Mar 17, 2008
HI all, we have a table that has it's primary key data type Bigint. Isthere any way with Access to view this table? I find it hard tobelieve that two tools from MS don't play nice with each other, may beI should.SQL Server 2005Access 2003TIA
View 5 Replies
View Related
Dec 20, 2007
For some reason when I go to view any video on http://msdn.microsoft.com/vstudio/express/sql/learning/default.aspx
it doesn't run. Can someone help?
Thanks,
Mark
View 1 Replies
View Related
Dec 19, 2014
I have a requirement regarding a color combination data. I have a lookup table that holds a colorid, p1, p2, p3, p4 to p8 which will be having colors Red, Green and Amber. P1 to P8 columns holds these three colors based on their combinations.
I have attached the look up table data for reference.I need to pass the color values to p1 to p8 and need to retrieve the color id based on the passed color. If we pass values for all p1 to p8 then it is easy to get the color code, however it will not happen. The passed values may be dynamic. ie we will not have all 8 values all the times. sometimes we will have 2 colors passed, sometimes 5 colors will be passed.
If i pass only two colors say red and red, i need the color id of only the row that has red and red for p1 and p2 alone. i dont want want all the colorid's that has red and red in p1 and p2 and some other colors in p3 to p4.
The exact colorid of the combination must be returned on passing the values to p1 and p2.I am passing Red and Red as values to P1 and P2. In the look up table we can have 10 rows that has red and red i p1 and p2 like
colorid p1p2p3p4p5p6p7p8
1 redred
10 redredred
20 redredred
30 redredredred
40 redredredredred
50 redredredredredred
60 redredredredredredred
70 redredredredredredredred
So the result must have only the colorid 1 and not all the colorid's listed above. when I pass 3 red as values for p1, p2, p3 then the result must be 10. Colorid 1, 20, 30, 40, 50, 60 and 70 must not come in the result.I need a function or procedure that will accept the arguments and provide me the result based on the values.
View 2 Replies
View Related
Sep 29, 2015
Currently i am using SQL Server 2012 Import/Export Wizard to upload data to sql tables manually. However i was trying to write a procedure to update that table. and on the time of execution, if i can pass excel. Is there any way to pass excel to stored procedure parameter?
View 1 Replies
View Related
Aug 28, 2007
hi!
i'am recieving this error :
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server).
anybody can help me please
thanks
View 1 Replies
View Related
Sep 19, 2006
I saw a presentation last week where the speaker created some sorta sql server "watch window" (in Sql Server Management Studio I think) where he could watch all the commands being executed on his sql server database in real-time. For example he could navigate to web pages (that hit the database) and as he pressed buttons you could see the sql commands execute in this "watch window." If other users hit the database at the same time you could see those sql queries execute as well. I didn't think at the time to ask how he did it - does anyone know how to set this up? I have a problem with my sql server right now and it would be useful to see which sql queries (etc) are being executed when. Thanks in advance,J. Shane Kunklejkunkle@vt.edu
View 2 Replies
View Related
Dec 17, 2005
I need to live update my SQL-Server 2000 database from AS400 database.
I usually use Access 2002 database between the AS400 database and the SQL-Server 2000 database to reflect any live update.
I use the (Link Tables...) option when creating a new table in access and link it with the ODBC to connect with the AS400 database.
After that I work with the Access link table.
Is there any tool in SQL-Server 2000 to show the live transactions in AS400 databasee so I can work on it?
Please advise
View 1 Replies
View Related
Jan 8, 2007
I have built the reports that I need using Visual Studio and the SQL 2005 Reporting Server, but now I need a way to view the reports via a web browser.
I am not much of a web/programming expert, so any help that could walk me through the process of publishing the .rdl files that I have created via a web browser would be much, much appreciated. Again, I am a novice in the the web arena, so the more straight forward the steps the better.
Thanks!
View 2 Replies
View Related
Jul 5, 2006
I never noticed it before, but I am now using Management Studio to administer our sql databases and the issue became apparent. One of the databases located on a sql 2000 server, says "6.5 compatible", when viewed from Management Studio (but not from Enterprise Manager).
What are the step needed to upgrade the database? (I think I need to run the Sql 2005 Upgrade Advisor first, fix any errors found, then manually change compatibility mode (to 80) from the sql 2000 server where the database is located. )
TIA,
Barkingdog
View 1 Replies
View Related
Nov 30, 2006
We still have some Legacy 2000 DTS packages running on our 2005 Server. The DTS packages have been configed to save the logs on the 2005 SQL server. We can manually look at the logs in 'msdb.dbo.sysdtspackagelog' and 'msdb.dbo.sysdtssteplog' table but I am looking for some GUI tools so our tech support can view the package logs without writting a query.
In 2000 Enterprise Manager, you can right click on a DTS package and select 'Package Log...' and then a nice GUI window will show up for you to browse through all the dts logs. I just can't find this tool in 2005 Server Management Studio for Legacy DTS packages. If I right click on a Legacy DTS package, all the option I get are 'Open, Migrate, Export, Delete, Rename, Refresh'... Since the log tables are still the same, I am wondering if there is anyway I can use that 2000 DTS log viewer in 2005?
Thanks.
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
Mar 20, 2007
Hello,
Picture tells more then 100 words. I cant get any components there.
http://www.pixilive.com/uploads/20070320/report.jpg
How i can fix that?
View 10 Replies
View Related
Jul 13, 2007
I work with a large and complex reporting system with several hundred reports: the Programmability; Stored Procedures node of the object explorer has become very difficult to navigate.
Is there any metadata that can be embedded in the stored procs that would create subfolders like the existing System Stored Procedures node in this node of the object explorer?
I suspect that the correct answers are:
Rename all your queries with a rational naming convention;
Cull the deadwood;
Assign them to categories then export them to separate databases.
Unfortunately, one of these has already been done, and the other two will break several hundred dependent processes - the recoding and retesting is neither economical nor desirable.
Still, all advice is welcome. Pitch your answers at a banking geek who does intermediate to advanced stored procedures and triggers, but isn't allowed to play with sharp things (like sys objects) - but I can probably get help from a grown-up on the sysadmin team: I have discovered that the rumours about human sacrifice are baseless, and they will perform favours in return for beer.
This is also a good time to ask: just how many stored procs and functions are you allowed in SQL Server 2005?
Nile.
View 5 Replies
View Related
Mar 10, 2015
I have a scenario where in I need to use a comma delimited string as input. And search the tables with each and every string in the comma delimited string.
Example:
DECLARE @StrInput NVARCHAR(2000) = '.NET,Java, Python'
SELECT * FROM TABLE WHERE titleName = '.NET' AND titleName='java' AND titleName = 'Python'
As shown in the example above I need to take the comma delimited string as input and search each individual string like in the select statement.
View 3 Replies
View Related
Mar 20, 2014
We have some URLs within a bulk block of text some of which are very long. I need to identify rows where such urls exceed say 100 characters in length in amongst other text.So the rule would be return a record if within the string there is a string (without spaces) longer than 100 characters.
View 9 Replies
View Related