|
Hello,
I'm new to database programming. I'm currently reading Pro ADO.NET 2.0 from Apress. The book has been great so far, but when he get's to his first example, he supplies a script file to set up a simple data source. So, i have this .sql file that i don't know what to do with. when I double click it, it just opens in notepad. Yes, i'm a doofus. please help me!
I'm running a local instance of sql server 2005 standard.
thanks!
Ian
|
|
|
|
|
Hi Ian. If you're running Sql Server 2005, you should have access to the Query Analyzer program, yes? Open the .sql file in Query Analyzer, then execute it (F5 will do it)
|
|
|
|
|
i can't find the query analyzer. I'm going to reinstall and give that a shot. Thanks!
Ian
|
|
|
|
|
SQL Server 2005 does not come with Query Analyser. That was a feature of SQL Server 2000.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
My mistake.
Thanks Colin.
|
|
|
|
|
Open Microsoft SQL Server Management Studio
Connect to the SQL Server
In the tree on the left open the databases folder
Right click on the database you want to query and select New Query...
In the main pane you can now type SQL. You can execute the SQL by pressing F5 or using the Execute button.
Does this help?
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
The system already has a default instance of MSDE2000 installed. I would liket to upgrade this to a default instance of SQL server 2000. Is this possible without uninstalling the MSDE? The SQL installation asks me for an instance name and disables the default instance (since it already exists in MSDE)??
|
|
|
|
|
Hi,
Can I get previous and current values of row in trigger for update operation.
Regards,
Shah A.
|
|
|
|
|
Use updated.colname
Live Life King Size
Alomgir Miah
|
|
|
|
|
Thanks for the reply Alomgir.
Can you pls elaborate? I think updated.colname will give the value after the execution of query. How can I get the previous value, so that I can compare both.
Regards,
Shah Adarsh.
|
|
|
|
|
I got the answer . deleted table contains the old record and the inserted table contains the newer one for update operation trigger.
Regards,
Shah Adarsh.
|
|
|
|
|
Hi there,
I am just trying to create an ENDPOINT to define a Web Service in Sql
server 2005. Here is my code
Create ENDPOINT AWService
STATE = STARTED
As HTTP
(
PATH = '/ADVENTUREWORKS',
AUTHENTICATION = (INTEGRATED),
PORTS = (CLEAR),
SITE = 'DEVI\SQLDM2005'
)
FOR SOAP
(
WEBMETHOD 'GetProductList'
(NAME = 'AdventureWorks.Dbo.GetProductList'),
DATABASE = 'AdventureWorks',
WSDL = DEFAULT
)
and when i run this T-SQL its complaining about
Msg 7807, Level 16, State 1, Line 1
An error ('0x80070057') occurred while attempting to register the
endpoint 'AWService'.
I am trying this code to run on Windows XP pro and Sql Server 2005. Any
clue why its complaining about this ?
Thanks
-D
|
|
|
|
|
Hi,
I'm using update trigger for inserting a record in a table(say table2) when the value of certain column(Column2) is changed in table1. My code executes UPDATE query on table1 everytime when any column is updated.
My SP is something like
UPDATE table1 SET Column1 = @Column1, Column2 = @Column2
WHERE ID = @ID
I have checked the following condition in Trigger
IF UPDATE(Column2)
INSERT INTO table2...........
So even if Column1 is updated the INSERT query in trigger will be fired.
So the record is inserted into table2 everytime the update query is executed on table1, irrespective of which column has changed.
Regards,
Shah A
|
|
|
|
|
As far as I can see in you UPDATE statement, both Column1 and Column2 are updated, so Column2 is always updated. Even if you put back the same value in Column2, as far as SQL is concerned, it is updated.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Yes but how can I compare the previous and current values for Column2 in the trigger to know that it has changed.
Thanks for the reply Marilyn.
Regards,
Shah Adarsh.
|
|
|
|
|
I got the answer . deleted table contains the old record and the inserted table contains the newer one for update operation trigger.
Regards,
Shah Adarsh
|
|
|
|
|
Hi:
I am connecting to my SQL server from my windows application localy using either SQLConnection or ODBCConnection and they are working fine but when i try to connect to the server from another PC in the Lan i cannot connect through SQLConnection from my application.
but what have i tried is to connect using odbcConnection and ODBCComand and it connected normally.
What Do i need to setup in the client computer So it Can connect from the Windows Application Normally By using SQL Connection and SQLCommands?
Do I need to setup:
1- A new ODBC System DSN with a SQL Server Driver!!
2- SQL Service Manager (How Do I Get It)
3- Define a new DB user for Clients (I am using it with ODBC Already)
4- Connection string in my application (I am using "Data Source=jedfin-nb0077;Initial Catalog=inventory;User ID=sharifin")
5-In the FORM in QUERY ("SELECT Count(*) FROM [jedfin-nb0077].inventory.sharifin.inventory_item")
Please Help and Thanks in Advance.
|
|
|
|
|
I have written a store procedure to insert a record which contains a parameter that contains loginname which is of type string. i want to trim this parameter in store procedure.
can any one help me in how to do this.
thnx.
|
|
|
|
|
LTRIM()[^]
RTRIM()[^]
SET @YourParam = LTRIM(RTRIM(@YourParam))
Jon Sagara
Look at him. He runs like a Welshman. Doesn't he run like a Welshman? Doesn't he? I think he runs like a Welshman.
Sagara.org | Blog | My Articles
|
|
|
|
|
Thanks for the suggestions, Jon
I tried it and my problem got solved.
Praveen.
|
|
|
|
|
I'm trying to create a view from the Visual Studio Server Explorer. One table I want to include belongs to a different database. When creating a view it only allows you to pick tables and views from within the database your working in. How can I pick a table from a different database for my view?
Thanks for any help on the matter.
|
|
|
|
|
Hi there. You can fully qualify each table with the syntax database.schema.table. For example, to fully qualify the Categories table in the Northwind database, you can use Northwind.dbo.Categories .
|
|
|
|
|
How do you do that within the Server Explorer? Thanks.
|
|
|
|
|
Does it work to make sure "Show SQL Pane" is turned on, then type in the fully qualified name in the sql itself?
|
|
|
|
|
Anyone can teach me how to connect two or more pc sql server together in a local area network?
chung
|
|
|
|