Hello i have tree structure in sql. Logics is standard: SomeID, ParentID, other fields.
I have select procedure, which selects data like this:
1.
1.1
1.1.1
and so on.
How to write the select procedure, to get the inverted result(first are selected the deepest branches, last - root branches), like this:
1.1.1.
1.1.
1.
2.2.2.2.2.
2.2....
I storing html to a text field. The html is a fully formed webpage and is stored on my server. I'm frequently updating this field. Currently, after updating the content (using Dreamweaver) and then validating that layout is correct in my browser, I'm manually pasting the HTML to a SSMS query. It'd be easier execute:
update template set ...
I would like to write a SQL script that executes multiple individual SQL statements; if any of those statements fail, I'd like to rollback the entire transaction. So, something like:
BEGIN TRANSACTION
insert into TestTable values (1)
insert into TestTable values (2)
insert into TestTabe values (3)
--if any of the statements fail
ROLL...
Consider an order. An order will have one or more line items. Each line item is for a particular product.
Given a filter table with a couple of products, how would I get the order id's that had at least all of the products listed in the second table?
table Orders(
OrderId int
)
table LineItems (
OrderId int,
LineItemId int...
I've been wrestling with the SSMS Solution in SQL 2008. I'm beginning to wonder if other professionals actually use this feature -- it just seems like it doesn't work well. Opinions? Avoid like the plague? Suggestions for using it properly?
...
I am not used to work with SQL Server(usually I just use express). I run it on windows server 2008, iis7.
I have attached the database to my sql server. I made a web site in iis7 but I get this error message.
Cannot open database "Phaeton.mdf" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK S...
How can I find sql server port number from windows? Is there any generic way to find port number for sql server 2000, 2005 and 2008?
...
Hi,
We have a database running on a shared host via SQL Server 2008. We are now in the position, due to performance constraints, where we have to move the database, along with a website. We use change tracking on the database so that clients can sync using the sync framework.
My question is: is the change tracking table stored within th...
How do you do pagination in sql server 2008 ?
...
This is hopefully just a simple question involving performance optimizations when it comes to queries in Sql 2008.
I've worked for companies that use Stored Procs a lot for their ETL processes as well as some of their websites. I've seen the scenario where they need to retrieve specific records based on a finite set of key values. I'v...
I'm trying to debug the source of a SQL timeout in a web application that I maintain. I have the source code of the C# code behind, so I know exactly what code is running. I have debugged the application right down to the line that executes the SQL code that times out, and I watch the query running in SQL profiler.
When this query ...
If I have a view, and embed the view in a query, will the view have to be processed fully before the rest of the query?
Example:
CREATE VIEW dbo.ExpensiveView AS
SELECT IndexedColumn, NonIndexedColumn
FROM dbo.BigHairyTable
WHERE NonIndexedColumn BETWEEN 500000000 AND 500050000
GO
SELECT * FROM dbo.ExpensiveView
WHERE In...
Hi. I been strugling with this for 2 days now without comming any closer to solution. I have read 20-30 threads alteast and stil can not resolve this.
Please help me out.
I have disable anonymous authentication, enable asp.net impersonation.
I have added <identity impersonate = "true" />
I have added the a user to the security logins...
We put a print statement at the top, so when we're running a query in SSMS the messages tab shows me that more may be happening than initially meets the eye.
Would there be much of a performance hit?
...
Hi,
I'm trying to update my existing SQL server 2008 SP1 installation with SQL Server 2008 R2 (November CTP).
I started the setup and chose the upgrade option and after some time the installer told me to reboot. As soon as I confirmed with OK, it crashed.
After rebooting I can't even run the setup file anymore. it crashes instantly ...
The error message I'm obtaining when trying to drop a column:
The object 'defEmptyString' is dependent on column 'fkKeywordRolleKontakt'.
Msg 5074, Level 16, State 1, Line 43
ALTER TABLE DROP COLUMN fkKeywordRolleKontakt failed because one or more objects access this column.
I have already tried to find the default constr...
I need to generate data in a database to test lucene. If anyone knows where I can get a sample database all a way to generate real life data please let me know.
I need to test millions of rows that contains real life articles.
...
the project I'm working on uses the OleDb provider classes to connect to various databases. I have no choice in the matter. I have to update it so that it works with the new "time" column type in SQL 2008. My connection string is using "Provider=SQLNCLI10;"... and this seems to know about all the types except "time". Whereas the SqlC...
Hi all.
I need help with this. I am looking for a complete TSQL code. (no c++/C#)
define 32 points around a central point forming a quasi circle with a given radius in miles.
Check the 32 above points against a given point to see if it is included inside the geo-fence.
Thanks
JJ
...
On a per-object basis, SQL Server Management Studio has the option to script the object to clipboard, file, etc. Is there a way (at the database level) to do a "1-click" export of ddl AND data to a text file? Ideally I'd like to select a database and create a big text file containing the ddl for all objects plus the data in all tables....