|
That does it! Thanks mate!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
You're welcome.
"Lots of programmers have had sex - some have even had it with members of the same species." - Pete O'Hanlon
|
|
|
|
|
Hi,
I'm going to deploy a Report Service Project, created in VS2008.
I've set these info:
OverwriteDataSources : False
TargetDataSourceFolder : \
TargetReportFolder : RSProjectTest (it's my project name)
TargetServerUrl : http://localhost/Reportserver
when I want to deploy 'Reporting Services Login' dialog appears. I've entered my sql login and my windows login, but none of them was accepted.
What should I do? what is this login ?
Best wishes
|
|
|
|
|
Hi
I installed Sql Server 2005 ManagemenStudio in my local machine to create sample tables in my local database. When I open the Sql Server its keep on asking me to connect to the server, can't I create local database and create tables and stored procedure there.
Can any one help me please.
Thanks in advance,
|
|
|
|
|
You should be able to connect to the localhost with windows authentication mode. Once you connect you can create databases and such. Doe sit give you an error message when you try to connect to the localhost?
|
|
|
|
|
You are totally missing the point.
In order to create any SQLServer database, whether local or remote, you have to be connected to an SQLServer server.
When you create the database you can set its location in the dialogue that Management Studio presents.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hello All,
I want to access different database(MySQL,Oracle,SqlServer etc) using ODBC dsn less connection with my application by providing the connection and database schema details at run time . so is there any specific connection string pattern which is accepted by all database providers. I mean to say
for MySQL connection string is like
Driver ={MySql Driver};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;Port=3306;
for oracle we have
Driver=(Oracle in XEClient);dbq=111.21.31.99:1521/XE;Uid=myUsername;Pwd=myPassword;
so it replaced Server with dbq .. so is there any standard string parameters which could be used irrespective to database. and only SQL based databases I need to connect.
I hope you understand what I want to say
Thanks
Param
|
|
|
|
|
I have been off work for some days now and since I came back this morning, I keep getting this error when I start my SQL Server 2005... this is the error:
"An Exception occurred while executing a Transact-SQL statement or batch
(Microsoft.SqlServer.ConnectionInfo)"
Additional Information:
Database 'msdb' cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information. (Microsoft SQL Server, Error: 926)
What can I do to rectify it because it keeps giving similar error each time I try to update anything in my database
|
|
|
|
|
tolucole wrote: See the SQL Server errorlog for more information.
And what did the the error log say?
|
|
|
|
|
Why you don't put error message in google and check for solution?!
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hi database experts,
How would you duplicate this table's data for the year 2009 taking care of the primary key column ID
ID NAME YEAR
-- ---- ----
1 A 2008
2 B 2008
3 C 2008
4 D 2008
To make it:
ID NAME YEAR
-- ---- ----
1 A 2008
2 B 2008
3 C 2008
4 D 2008
5 A 2009
6 B 2009
7 C 2009
8 D 2009
Please help guys,
Many thanks!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
insert into tablename<br />
select name,'2009' from tablename where [year]='2008'
Hope it will help you.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hey there,
Thanks for your time but I get an error message of not enough values obviously because of ignoring the ID column, this's what my test table looks like:
SQL> DESC TEST
Name Null? Type
----------------------------------------- -------- ----------------
ID NOT NULL NUMBER
NAME VARCHAR2(10)
YEAR NUMBER(4)
SQL>
And I tried
SQL> INSERT INTO TEST
2 SELECT NAME,2009 FROM TEST WHERE YEAR=2008
3 /
INSERT INTO TEST
*
ERROR at line 1:
ORA-00947: not enough values
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi there, I found the answer and thought to let you know...
CREATE SEQUENCE SEQ_TEST
MINVALUE 1
START WITH 1
INCREMENT BY 1
CACHE 20
ORDER
/
CREATE OR REPLACE TRIGGER TRG_TEST_AUTONUMBER
BEFORE INSERT ON TEST
FOR EACH ROW
WHEN (NEW.ID IS NULL)
BEGIN
SELECT SEQ_TEST.NEXTVAL
INTO :NEW.ID
FROM DUAL;
END;
/
Now I can insert values the way you suggested but it will still be problematic that the sequence generates values already in the table's ID column.. Any idea how to make the above sequence starts with the MAX(ID) FROM TEST ??
Many thanks mate!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
I'm glad that you found solution,by the way I apologyse because I didn't have free time to explore more solutions for your question.
Are you using Oracle as backend database,right? If yes then I didn't use yet Oracle because for our clients is enough MS SQL Server as backend database.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hi Experts
Pls Help Me .
When i Login to SQL Server 2005 It Always Run in SQL server Authication mode Not in Window Auth. Mode. I mean to Disable The Window Auth. mode.
if It is not Possible Then How I Can Implementing Security on Particular Database even in Window Auth. mode .
So That Another Person Not To Open The database even in Window Auth. Mode.
Thank U
Dinesh Sharma
Software Developer
|
|
|
|
|
Sharma Dinesh Kumar wrote: I mean to Disable The Window Auth. mode.
That's not an option on the securities tab.
Sharma Dinesh Kumar wrote: So That Another Person Not To Open The database even in Window Auth. Mode.
The owner should be able to query the database, but you can argue about who the owner is. That might be a "real" user (a person), but it might also be an account that's specific for your application (a program account). There's an ASP.NET account on your machine that you probably don't have a password to. Similar, you might create an account for your SQL-demands, giving rights to that account to read/write to the database.
I are troll
|
|
|
|
|
I created a temp table with an order by clause. If later on I query it, would my result set still follow the order by sort or is it going to be indeterminate like querying an actual table? This is hard to test because 999 of 1000 times I might get an ordered result set.
Thanks in advance.
----------------------------------------------------------
Lorem ipsum dolor sit amet.
|
|
|
|
|
data in temp table will remain in the state and order as its been inserted untill you make any operation(sorting,shorting etc) on it
|
|
|
|
|
are you sure? someone answered differently from another (dbforums) forum.
----------------------------------------------------------
Lorem ipsum dolor sit amet.
|
|
|
|
|
The somone else doesn't know what they are talking about.
Simple to test, create a table with 1 field, insert 2 records and then select from the records. They will ALWAYS be returned in the order they were inserted unless you order them.
Here you go
DECLARE @tbl TABLE (sField VARCHAR(20))
INSERT @tbl (sField) VALUES ('Z')
INSERT @tbl (sField) VALUES ('A')
SELECT * FROM @tbl
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The first thing to clear up is that you cannot control the insertion order of rows using ORDER BY, so the assumption on which the question is based is inaccurate. This is well documented in Books Online and elsewhere (see refs below).
If you insert rows one at a time then it is true that the insertion order determines the allocation order represented by IAM pages. It will not determine the eventual ordering of data pages however, or even necessarily the logical ordering of rows within a page, especially if page splits subsequently occur.
In a query, there is no way to specify how rows should be sorted other than by using ORDER BY. This is an important feature because it allows the optimiser to choose the most efficient path to the data based on requirements. By leaving out ORDER BY you signal to the optimiser "I don't care about order" and the optimiser chooses an execution plan accordingly. Check this for yourself by looking at the execution plan of a query without ORDER BY. You will typically see a scan showing "Ordered=False". Depending on various factors the optimiser can choose different strategies to retrieve the data for an unordered scan, which may or may not mimic the order in which rows were first inserted. Some relevant factors that influence the actual plan and sorting are: fragmentation, covering indexes and whether an "Advanced" scan is used (Enterprise Edition only).
Of course it is easy to contrive examples where the query order matches the insertion order and just as easy to make up examples where it doesn't. Just as surely, those nice safe examples could return different results if the conditions under which they ran were changed in some subtle way.
The correct and documented behaviour is that the sort order of a query without ORDER BY is undefined. If you ever assume otherwise then you are in unsupported territory and you must decide for yourself whether it is worth the possible risk of leaving out ORDER BY.
Hope this helps.
References
Insertion order not guaranteed for SELECT INTO with ORDER BY:
http://msdn.microsoft.com/en-us/library/ms188385.aspx
Insertion order not guaranteed for INSERT with ORDER BY (SQL Engine Team Blog):
http://blogs.msdn.com/sqltips/archive/2005/07/20/441053.aspx
Advanced Scan:
http://msdn.microsoft.com/en-us/library/ms191475.aspx
Ordered and Unordered Scans:
Inside Microsoft SQL Server 2005 T-SQL Querying, Chapter 3
http://www.sql.co.il/books/insidetsql2005/
Queries without ORDER BY are unordered:
http://technet.microsoft.com/en-us/library/cc917540.aspx
http://msdn.microsoft.com/en-us/library/ms187956.aspx
|
|
|
|
|
Thanks for that info - I have never actually dug under the hood of the way a db treats the rows as I also am of the opinion that I don't really care, if I need a sort order I will impose it.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Microsoft do not guarantee the order any records are returned unless you put an order by on the select. The default is to return the data in the prmary key order, but this cannot be relied on.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Greetings All,
I have a particular problem that I am hoping someone with some TSQL know-how can assist me with.
Here's the issue:
I have a table that contains 40 some-odd columns. the first 2 columns are essentially identifiers. The following columns are components of the identifier. To give a clear picture, lets' say the first row has CHCK in the 1st column and Chocolate Cake in the 2nd column. The rest of the columns contains the ingredients of the Chocolate Cake (let's say 7 ingredients). The next row is for Grilled Cheese. This row would only have 3 ingredients.
Here is what I would like to achieve:
I want to run through each row and read every column to see if there is a value in it. If there is a value, I would like to put the identifier and the ingredient in another table with an insert so that this new table (with only 2 columns) looks something like this
CHCK eggs
CHCK milk
GCHEES bread
GCHEESE cheese
Is there a way that I could do this in a stored procedure? I know that I could use a cursor to the rows but each row could have a variable number of *ingredients* and that is where I am lost.
Thank you in advance for any suggestions you may offer.
|
|
|
|