Explain To Noob, Database Uploading

Dec 25, 2007

hi,

From my ealier post I learned that a MDF file can be read and written to even if I did not attach the database in the SQL Sever Management Studio.

Is that behavior because of the connection string where is has 

AttachDBFilename=|DataDirectory|DNN12_24_07.mdf  ,

Is that what "attaches" the database?  This runs on SQL Express2005.

Should I change the connection string  to:

 name="SiteSqlServer"  connectionString="Server=(local);Database=ASPNET;uid=;pwd=;" providerName="System.Data.SqlClient" />

?

Is there a statment in the XML of web.config that defines |DataDirectory| of the original connection string  that points to APP_DATA where the mdf file physically resides?

Thanks in advance?

-KK


  

View 1 Replies


ADVERTISEMENT

Uploading An Sql Database

Oct 3, 2006

hi,my sql database works fine from my desktophowever when uploading it to my web server it does not work.i considered this could be the connection path to the database.in visual web developer i attempted to modify the connection for the actual web address on the server pc like this:C:Inetpubvhostsarcvillage.comhttpdocsApp_Datavillagers.mdf this is the actual path on the server.However visual web developer will not allow this because it says that this connection is not available ON MY PC.... so i cant save this new connection in order to upload it.any suggestions please.... or am i barking up the wrong tree!

View 8 Replies View Related

Regarding Uploading A Database

Jan 22, 2008

i need to upload a database(mssql2000) into a remote server.i usually generate script of the source database and run that script in the sqlanalyser in the server and generate all the tables,sp,views, etc. but not diagram.
but currently i am using a diagram with relationship set between different tables in my local machine, i don't know how to upload this diagram to the remote server, if know any method pls reply.......
 
 
 
 

View 1 Replies View Related

Uploading Image To Database

Nov 4, 2006

I'm trying to upload an image to a database along with some other info. I have a form to get all the info from the user that I want to put in the database. Everything's getting into the database except for the actual image data. When I do a "select * from table" query on the database, the Image field reads "err", however I have an imagetype field in the db and it reads "image/jpeg". I have the following code to get the image into the database:

View 2 Replies View Related

Uploading Files To SQL Database

Mar 19, 2006

I was following an example from the book "ASP.net unleashed" in Chapter 14, where it describes how to upload a file directly into the database.
I got it to insert the file into my database as described, and with changes created a master and detail form to select the file and display it.. (which I assume had worked).
Except, when attempting to access the file it gives two different errors. For a ppt file it gives:


The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.


An invalid character was found in text content. Error processing resource 'http://localhost:3870/SeminarOrganiser/view_file...


and for a simple txt file:


The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.


Invalid at the top level of the document. Error processing resource 'http://localhost:3870/SeminarOrganiser/view_file.aspx?...SELECT suggestEvent.suggestID, suggestEvent.uID, users.uFirstName, users.uLastName, users.uEmail, suggestEvent.suggestTitle,...From these two errors, I cannot really make sense of what has gone wrong or even why XML has even been mentioned. Looking around on the net has not allowed me any further progress.In any case, would anyone be able to explain to me what might have gone wrong?Alternatively, any links that may help would be greatly appreciated.Thank you very much in advance.

View 1 Replies View Related

Correct Way To Attach Database When Uploading.

Dec 26, 2007

hello,
After I FTP a ASP.NET website to a webserver,  APP_DATA directory and all,   I then use the SQL publishing wizard to create a script on the local machine and run the script on the webserver/SQL server, it builds ok.  But I get an error "another database with the same name".  Duplicate of the database in APP_DATA directory that is already attached by the connection string.  So this isn't correct.
Second attempt:  I FTP an ASP.NET website up to a server.  Then I open the SQL management studio and attach the database in the website's APP_DATA folder.  (never running a .sql script)The database attaches.  The name of the database is the complete path to the database in the APP_DATA directory by default.  The website functions.  But if I try to look at a table I get an errors.  It gets to the point the database will not even expand.  Then I start getting errors in the browser that NETWORK SERVICE can not open it's default database.  So the website fails also.  So this doesn't work either....
 So I guess my question is, should I remapped the path of |DataDirectory| before I FTP it?  To a path where the other common system databases reside,  (I don't think that would be necessary.)    Then FTP the website without the contents of the app folder(no database).  Then use the script built with the SQL Publishing wizard to build the database,  and attach the database in SQL Management Studio?  ( I'm afraid of over playing and corrupting the server).
If I attach the database to manage it and the connection string attaches the database to run it,  will I always get errors?  What am I missing here?   
Thanks jamesqua for your help so far,  I understood the blog you sent me too.  But how do I modify it so I can use SQL Management studio to manage the database?  
Once again from My Uncle Bob "Things are simply awful,  or awfully simple"
-KK

View 5 Replies View Related

Uploading Different Kinda Files Into SQL Database :((

Apr 6, 2005

Hi everyone!
 i am working on an web application database(asp.net,c# and sql server), wherein i wanna upload and retrieve different kinda files .
so guys, plz do, give me some info abt how exactly i can carry out the task and if possible give me the snippet too(hmm,, very lazy....)
thanx in advance
regards
kiran 

View 1 Replies View Related

Difficulty Uploading Information To Database

Dec 1, 2005

This is probably a very simple question but i am having problems with inserting information into database
The function takes the values "FirstName" And "LastName" from  A table Called "Customer" and the value "ProductID" from a table called "Products" and inserts them into a table called " NewOrder".
Everything compiles ok but when I press the button the information is not uploaded to thedatabase. ( There is no error message)
This is the stored procedure
CREATE PROCEDURE SP_NewOrder(@CartID char (36), @CustomerID Varchar (50))AS
INSERT INTO NewOrder (FirstName, LastName, ProductID)
SELECT Customer.FirstName, Customer.LastName, Products.ProductID
From Customer,Products Join ShoppingCart ON Products.ProductID =ShoppingCart.ProductIDWHERE ShoppingCart.CartID = @CartID AND Customer.CustomerID = @CustomerIDGO
This is the Function
Public Shared Function CreateOrder() AS String   Dim customerID As integer   Dim connection as New SqlConnection(connectionString)   Dim command as New SqlCommand("SP_NewOrder",connection)   command.CommandType = CommandType.StoredProcedure   command.Parameters.Add("@CartID", SqlDbType.Char,36)   command.Parameters("@CartID").Value = shoppingCartID   command.Parameters.Add("@CustomerID", SqlDbType.Varchar,36)   command.Parameters("@CustomerID").Value = customerID  Try
  connection.Open()  command.ExecuteNonQuery()  Finally  connection.Close()
        End TryEnd Function
This is the page code
Sub btn3_Click(sender As Object, e As EventArgs)Dim cart as New ShoppingCart()Dim shoppingCartID As IntegerDim customerID As Integer = Context.Session("worldshop_CustomerID")cart.CreateOrder()End Sub
Can Anyone see where I am going wrong
Many thanks
martin

View 2 Replies View Related

Uploading Data From A Different Type Of Database

Dec 22, 2006

How do I upload test data from a frame maker database to SQL database tables using ODBC.

View 6 Replies View Related

Urgent -- Uploading Database And Tables On Internet

Jul 2, 2007

i have created site on asp.net using database sql server 2000 . i want to upload database and tables on internet. But i dont know how to do that.
Please help me. i have very less time.
 
 

View 5 Replies View Related

Question About Uploading A File From Webpage To Database

Oct 7, 2005

Hi all, I want to upload a text file from a webpage and save the content to our SQL Server database, a BLOB image column.  I got an error on [myData] in the following sqlparameter: Dim parmBlob As New SqlParameter("@AppResume", SqlDbType.Image, myData, ParameterDirection.Input, False, 0, 0, Nothing, DataRowVersion.Current, myData) - Value of type '1-dimensional array of Byte' cannot be converted to 'Integer'  How to fix it? Also,Did I do the right code to upload a text file? Thank you. --------------------------------------------------------------------------- Sub UploadResume_Click(ByVal source As Object, ByVal e As EventArgs)     Dim ResumeFile = uploadResume.PostedFile     Dim contentType As String = ResumeFile.ContentType     Dim contentLength As Integer = ResumeFile.ContentLength     Dim myData(contentLength) As Byte     ResumeFile.InputStream.Read(myData, 0, contentLength)     If Not (uploadResume.PostedFile Is Nothing) Then       Try         'upload file to SQL Server         If Not conHRISDb.State = ConnectionState.Open Then           conHRISDb.Open()         End If         Dim strSQL As String         strSQL = "Insert into Mgmt_App_Resume_Table (Applicant_ID, App_Resume) Values (@AppID,@AppResume)"         Dim objComd = New SqlCommand(strSQL, conHRISDb)         Dim parmBlob As New SqlParameter("@AppResume", SqlDbType.Image, myData, ParameterDirection.Input, False, 0, 0, Nothing, DataRowVersion.Current, myData)         objComd.Parameters.add(parmBlob)         objComd.ExecuteNonquery()         conHRISDb.Close()       Catch exc As Exception         conHRISDb.Close()              End Try     End If   End Sub

View 1 Replies View Related

BIDS Noob Requesting Help With Error Attaching Auto-named Database

Apr 25, 2008

Greetings, helpful people of the Internet.

I'm learning to use BIDS, and have been going through the exercise in Chapter 19 of the book Professional SQL Server 2005 Integration Services. I'm probably in over my head with this since I've never used any SQL services/software before, but the company I'm interning at wants to build a workflow using SSIS, and for some reason unbeknownst to me, I volunteered to train myself for the task. I'm at a part in the book exercise where I'm editing one of the components of a Data Flow task - an OLE DB Destination. When I try to select the table/view in the editor for this, it gives me the following error:


€œAn attempt to attach an auto-named database for file C:Documents and SettingsgroseMy DocumentsVisual Studio 2005ProjectsCase Study ExerciseCase Study ExerciseCase Study.database failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.€?


When I googled this, most people seemed to be getting it through other SQL software, so I'm not sure if the error has the same cause or not. I know that the file in the above error message already exists, but I don't understand why the task editor won't just let me select a database that already exists so I can complete the component. Can anyone explain this to me?

View 1 Replies View Related

Fast Uploading Data From Client To SQL2000 Database

Mar 4, 2005

Does anyone know how to upload (bulk) data from a client (written in Excel VBA) to a remote SQL2000 database? Of coarse I tried "INSERT INTO" and rst.addnew but I noticed this is much, much slower as downloading from the same remote database.

Thanks.

View 3 Replies View Related

Uploading A File To A SQL Database Via A Typed Dataset And Using The FileUpload Control.

Oct 2, 2006

I am trying to upload a file in ASP.net 2.0 to a SQL database using the FileUpload control. I am doing this by way of a typed dataset.Here is my code.Dim rta As New ResponseTableAdapterDim rdt As ResponseDataTable = rta.GetResponseByID(1)Dim rr As ResponseRow = rdt(0)Dim fs As New FileStream(fu.PostedFile.FileName, FileMode.Open, FileAccess.Read)Dim br As New BinaryReader(fs)Dim image() As Byte = br.ReadBytes(fs.Length)br.Close()fs.Close()rr.UploadFile = imagerr.NameFile = fs.Namerta.Update(rdt)The code runs without an error but afterwards I find that nothing has been stored in the UploadFile cell in the database but the file name has been stored in the NameFile cell in the database. Any ideas?Your help is much appreciated. James 

View 1 Replies View Related

SQL 'Server' Or 'Local' Database For Uploading To Hosting Service Provider

Mar 23, 2007

Hi, I'm developing a website using VWD 2005 Express, which needs a Membership system and a products database. Using the VWD inherent Web Site Administration tool makes the membership set up easy but by default it creates a 'Local' SQL database in a folder named 'Apps_Data' in the VWD project. My question is: considering I will need to upload my web site to a Hosting Service, would it be better to change the default so that the membership systems, and the product database I need, are created in an SQL 'Server' database instead of a 'Local' database?
The hosting service I am considering using is having a bit of a problem understanding this question, I hope it makes sense to someone or am I asking a stupid question?
Regards
Sean.

View 2 Replies View Related

Uploading Database To Sever With Sql Server Management Studio Express

Jun 28, 2007

Hello,



I would like some help in uploading a database from my harddrive to a server using sql server management studio express.



If I try to attach it to the server, this program only looks at the files on this server and not on my harddrive. So how can I copy a sql database to my folder on the server.



I am sure it must be a simple problem, but I've been bizzy with it for about a day now. So, please advice.



Rgds,



Wouter.

View 7 Replies View Related

Errors When Uploading DDL And Data File Created By Database Publishing Wizard

Jul 17, 2007

Hi,



I needed to recreate/publish a DDL and data file(of a database) that was produced using Database Publishing Wizard. The size of the file is 4G. I receive the following error when I try to open it up in the new query window of sql server 2005 (sp2)for execution.



"The operation could not be completed. Not enough storage is available to complete this operation."



I know my server has 829G of free storage space available. i receive no errors when I open up a smaller file also created by database publishing wizard.



What possibly is causing this?



Thanks in advance

View 3 Replies View Related

Uploading An SQL Server Express Database To A Server

Oct 8, 2006

I am new with Visual Web Developer SQL Express and for a start I have been using the VWDHosting.net (Trial hosting for VWD 2005 Express) with a test website using login and membership controls. I followed the excellent instruction in the User Guide (for transferring data and adapting the connectionstring) and it worked succesfully. However, I have problems getting the same test website installed with my hosting provider.The VWDhosting.net has a special functionality for uploading the contents of a local database to a database created on the server. In the Restore database section is a field the "Restore database from SQL Server 2005 mdf file". After selecting in that field your local database, you can click the "Attach"-button and then the contents of the local database are transferred to the database on the server. With my hosting provider (using SQL Server 2000) I have to use the same procedure: creating a MS SQL database on the server and then transfer the contents of my local database. How can I do this? (My hosting provider does not offer me a similar "Attach" button).Do I have to use SQL Server Management Studio?Kees

View 1 Replies View Related

Uploading SQL Server Database To A Server?

Mar 4, 2005

All right, I've got a small sample of database-driven code running nicely on my own computer using an MS SQL database with code something like this to connect to it. (passwords and user ID's changed to protect the innocent)


connect_String = _
"Data Source = mysource;User ID=joeblow;Password=monkey;database=Reservation"
db_conn = New SqlConnection(connect_String)


Now, I want it to run on a web server, but there doesn't seem to be any simple "click here to upload your database without tearing your hair out in frustration" button. Only an option to "add ODBC data source" which has the following fields:
data source name(dsn): ________
ODBC Driver Name: SQL Server (this value cannot be changed)
DSN Description: ________
Associated SQL Server:_________
Default Database Name:_________

Without any option to upload any database files, though if I go into file manager, I notice that there is an MSSQL folder, which I assume I should be uploading the database into. But which file(s) from my database should I upload and what should I fill the blanks above in with? Thanks in advance. Do I have to change the connection code?

View 4 Replies View Related

Can Someone Please Explain This To Me...

Jun 26, 2007

why do the following return the same datasets?
 select * from myTable where myData = ''
 select * from myTable where myData = '     '
in the first I'm specifically searching empty strings, in the second a sequence of five spaces. Yet both return any and all white character matches? Is this a "feature" of SQL...
P.S. I'm using T-SQL

View 2 Replies View Related

How Do I Run 'explain' On A Sql??

Jun 27, 2001

Hi, does anyone know how to run an 'explain' on a sql query on SQL Server 2000?

Thanks.

View 1 Replies View Related

Could Someone Please Explain The Following...

Dec 1, 2005

As previous threads have indicated I've been trying to figure out what's slowing down our 3rd party ETL tool.

My research has figured out the culprit, but now I need some advice on the best way to handle it.

Here's what's going on...
SPID 1 = dynamic sql passed from Crystal
SPID 2 = ETL tool
SPID 3 = report in stored proc

Until a few days ago we didn't even know SPID 1 existed. These are different guys, using old version of Crystal passing crappy queries.

Here's the scenario
SPID 1 is running (inefficient select)
SPID 2 is waiting
30 minutes pass and SPID 2 is still waiting PAGEIOLATCH_SH
SPID 3 fires off

Now SPID 2 is blocking SPID 3, but SPID 2 is still waiting for SPID 1

Finally when SPID 1 finishes, everything catches up. But it appears that there is a period of at least 45 minutes when all SPID's are just sleeping.

My questions:
1. If SPID 1 is just running an inefficient select query, why is it holding up SPID 2 (Which reads and inserts). SPID 1 should have a shared lock on table, this would prevent SPID 2 from insert/update?
2. Is there any steps I can take to give SPID 2 precendence? or is it first come first serve?

Thanks in advance

View 10 Replies View Related

Explain

May 2, 2008

Any one explain me about this query exactly wat it will do

backup log iiswebappauditdb with truncate_only

View 3 Replies View Related

Explain Me

May 8, 2008

set @tb1='rptmain.Month01.DBO.LCDB' in

View 1 Replies View Related

Can U Just Explain....

Nov 3, 2007

Query:
insert into aaaa values(',Â?'&',',Â?'&');

BUJJI.

View 6 Replies View Related

Can Some Explain This To Me?

Oct 25, 2007

Hello,I run the following query on a database (SQL 2005):delete from person where pers_companyid in (select pers_companyid fromcompany where comp_expiry is not null)I wanted to delete all people associated with a company which had anexpiry date. The mistake I made was that the column pers_companyiddoes not exist. It should have been comp_companyid.However, the query ran anyway and deleted all records from my persontable? If I run the subquery on its own then it doesn't run as thecolumn is missing.Shouldn't I have got an error running this query?Thanks,David

View 2 Replies View Related

Please Explain Transaction For Me

Sep 29, 2007

 I found this on http://msdn2.microsoft.com/en-us/library/86773566.aspx which i am hoping may be able to resolve my problem but I am not sure I actually understand it. Where it shows // Start a local transaction. transaction = connection.BeginTransaction("SampleTransaction");
is the "SampleTransaction" nothing more then just a name of the transaction that is being created through this code or is it actually pointing to something?I believe that I understand the rest. Oh and in case you have a better way of doing what I am needing here is the SQL Query that is pulling info for me to display on a pageSELECT     p.product_ID, p.class_ID, p.category_ID, p.product_name, p.product_desc, p.product_image, p.product_dimension, p.product_o1, p.product_o2,                       p.product_o3, p.product_ac, p.product_ph, p.product_photo, pcl.class_name, pca.category_nameFROM         products AS p INNER JOIN                      productClass AS pcl ON p.class_ID = pcl.class_ID INNER JOIN                      productCategories AS pca ON p.category_ID = pca.category_IDBasically I am using the transaction to perform multiple updates seeing as how I will need to update multiple tables.  private static void ExecuteSqlTransaction(string connectionString){ using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); SqlCommand command = connection.CreateCommand(); SqlTransaction transaction; // Start a local transaction. transaction = connection.BeginTransaction("SampleTransaction"); // Must assign both transaction object and connection // to Command object for a pending local transaction command.Connection = connection; command.Transaction = transaction; try { command.CommandText = "Insert into Region (RegionID, RegionDescription) VALUES (100, 'Description')"; command.ExecuteNonQuery(); command.CommandText = "Insert into Region (RegionID, RegionDescription) VALUES (101, 'Description')"; command.ExecuteNonQuery(); // Attempt to commit the transaction. transaction.Commit(); Console.WriteLine("Both records are written to database."); } catch (Exception ex) { Console.WriteLine("Commit Exception Type: {0}", ex.GetType()); Console.WriteLine(" Message: {0}", ex.Message); // Attempt to roll back the transaction. try { transaction.Rollback(); } catch (Exception ex2) { // This catch block will handle any errors that may have occurred // on the server that would cause the rollback to fail, such as // a closed connection. Console.WriteLine("Rollback Exception Type: {0}", ex2.GetType()); Console.WriteLine(" Message: {0}", ex2.Message); } } }} 

View 1 Replies View Related

Please Explain This SQL Trigger

Sep 25, 2005

I am new to triggers.I am unsure why on the SELECT statement the ROLLBACK is enforced. I thought this would be only for when an attempt is made to insert the data. Also what is the pupose of IF @counter = 1 When does this counter change value? USE Northwind GO CREATE TRIGGER PriceCheck     ON [Order Details]     FOR INSERT     AS DECLARE @counter int     SET @counter= @@ROWCOUNT     DECLARE @unitprice money     DECLARE order_details_insert_cursor CURSOR FOR         SELECT Unitprice             FROM inserted     IF @counter = 1         BEGIN             IF(SELECT UnitPrice FROM inserted) > 300             -- If the price entered is greater than 300             BEGIN                 --print a warning                 PRINT 'Cannot enter price greater than 300'                 --Take back the command                 ROLLBACK TRANSACTION             END         END     ELSE         BEGIN             OPEN order_details_insert_cursor             FETCH NEXT FROM order_details_insert_cursor INTO @unitprice             WHILE @@FETCH_STATUS = 0                 BEGIN                     if @unitprice > 300                     -- If the price entered is greater than 300                     BEGIN                     --print a warning                         PRINT 'Cannot enter price greater than 300'                         --Take back the command                         ROLLBACK TRANSACTION                         RETURN                         --Exit trigger immediately                     END                     FETCH NEXT FROM order_details_insert_cursor INTO @unitprice                 END                                  CLOSE order_details_insert_cursor             END                          DEALLOCATE order_details_insert_cursor

View 3 Replies View Related

Explain Xp_cmdshell

Feb 2, 2006

I've got some questions about xp_cmdshell and was hoping someone could explain some things to me.  I've written a trigger for a table that uses 'xp_cmdshell' to launch a VB.Net application.  The syntax is correct and it "seems" to work but in the way I intended.  When the app launches there is no GUI present but when I check the task list I see that the exe has been launched.  This intrigued me so I started playing with it in Query Analyzer.  When I run the commandexec master.dbo.xp_cmdshell 'C:WINDOWSsystem32otepad.exe'I seen a process for notepad show up on my processes list started by 'system' as opposed to myself and notepad still doesn't open up for me to see.  I also noticed that the query executes until I kill that particular process.  I'm guessing cause it's waiting on the tranaction to complete.  What I want to know though is why can't I see the program when I open like this?  Is it because 'system' is the user behind it or is there some extra parameter to throw in the xp_cmdshell?  

View 3 Replies View Related

EXPLAIN Function

May 19, 2008

Is there some equivalent to MySQL's EXPLAIN function? (or some utility that does the same thing?)

Basically the function takes a query and will return a list of the tables in the query and the number of rows that would need to be checked. It's used to check how well the indexes are set. (If a table returns a very high number, that could be a bottleneck for the query).

Any help is appreciated. Thanks.

-D. Israel

View 1 Replies View Related

Explain Plan

Mar 17, 2008

Dear All,
what exactly is ExplainPlan and maintenance plan? and where would we use these?


i've found some artilce in the NET, but i'm not satisfied


please provide me good articles and your words for me

Vinod
Even you learn 1%, Learn it with 100% confidence.

View 1 Replies View Related

Can Someone Explain This Behaviour?

Jul 23, 2005

Hello All,The following script is reproducing the problem assuming you haveNorthwind database on the server.Please note it gives you the error message on line 12.USE tempdbGOsp_addlinkedserver 'Test17'GOsp_setnetname 'Test17', @@SERVERNAMEGOIF EXISTS (SELECT 1 FROM dbo.sysobjects WHERE id =object_id(N'[dbo].[This_works]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)DROP PROCEDURE [dbo].[This_works]GOCREATE PROCEDURE This_works@UseLinkedServer bit = 0-- WITH RECOMPILE -- Does not helpASSET NOCOUNT ONIF @UseLinkedServer = 1 -- Linked ServerBEGINIF EXISTS (SELECT 1 FROM dbo.sysobjects where id =object_id(N'[dbo].[Orders_TMP]') and OBJECTPROPERTY(id, N'IsUserTable')= 1)DROP TABLE dbo.Orders_TMPSELECT * INTO dbo.Orders_TMP FROM Test17.Northwind.dbo.OrdersENDELSE -- LocalBEGINIF EXISTS (SELECT 1 FROM dbo.sysobjects where id =object_id(N'[dbo].[Orders_TMP]') and OBJECTPROPERTY(id, N'IsUserTable')= 1)DROP TABLE dbo.Orders_TMPSELECT * INTO dbo.Orders_TMP FROM Northwind.dbo.OrdersSELECT 1 FROM dbo.Orders_TMP WHERE 1 = 2 -- Why do I need this line?ENDBEGIN TRANSACTIONSelect 'Line 25'SELECT COUNT(*) FROM dbo.Orders_TMPCOMMITgoIF EXISTS (SELECT 1 FROM dbo.sysobjects WHERE id =object_id(N'[dbo].[This_does_not]') and OBJECTPROPERTY(id,N'IsProcedure') = 1)DROP PROCEDURE [dbo].[This_does_not]GOCREATE PROCEDURE This_does_not@UseLinkedServer bit = 0-- WITH RECOMPILE -- Does not helpASSET NOCOUNT ONIF @UseLinkedServer = 1 -- Linked ServerBEGINIF EXISTS (SELECT 1 FROM dbo.sysobjects where id =object_id(N'[dbo].[Orders_TMP]') and OBJECTPROPERTY(id, N'IsUserTable')= 1)DROP TABLE dbo.Orders_TMPSELECT * INTO dbo.Orders_TMP FROM Test17.Northwind.dbo.OrdersENDELSE -- LocalBEGINIF EXISTS (SELECT 1 FROM dbo.sysobjects where id =object_id(N'[dbo].[Orders_TMP]') and OBJECTPROPERTY(id, N'IsUserTable')= 1)DROP TABLE dbo.Orders_TMPSELECT * INTO dbo.Orders_TMP FROM Northwind.dbo.Orders--SELECT 1 FROM dbo.Orders_TMP WHERE 1 = 2 -- Why do I need this line?ENDBEGIN TRANSACTIONSelect 'Line 25'SELECT COUNT(*) FROM dbo.Orders_TMPCOMMITGOPRINT 'This_works'EXECUTE This_works 0PRINT ' 'PRINT 'This_does_not'EXECUTE This_does_not 0Thanks for any help or hint,Igor Raytsin

View 8 Replies View Related

Explain Plan

Jul 20, 2005

Hello.Does someone of you know if is there a 'explain plan' like function in SQLServer (similar to explain plan in Oracle or DB2)If so then how it works, where stores data and how it can be retrieved?Best regardsBagieta=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=dbDeveloper - Multiple databases editorhttp://prominentus.com=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved