|
Yeah, exactly thats all i want!! I tried it in different ways but couldn't succeed
Thanks a lot Buddy!!
|
|
|
|
|
|
I created a table in SQL Express with an autoinc column. When I remove the autoinc the table will create, but when I make the id column an auto increment it will not creawte the table.
Does anyone know why?
Is there aqnother way to auto increment with sql express?
Here is the table.
create table tbl_teachers (<br />
teach_id int AUTOINC NEXTVALUE 1 STEP 1,<br />
teach_fname text,<br />
teach_lname text,<br />
teach_add text,<br />
teach_unit_num text,<br />
teach_city text,<br />
teach_state text,<br />
teach_zip int,<br />
teach_instruments text,<br />
teach_email text,<br />
teach_phone int,<br />
teach_cell int,<br />
primary key(teach_id));
Here is the error I get.
Msg 102, Level 15, State 1, Line 3<br />
Incorrect syntax near 'AUTOINC'.
|
|
|
|
|
AUTOINC NEXTVALUE is Visual FoxPro syntax. IDENTITY is the SQL Server equivalent.
Paul Marfleet
|
|
|
|
|
OleDb connects fine?
VS2005; C#; SQL 2005 Developer (remote server)
SqlClient connection string:
"data source=MyRemoteServer;user id=MyUserID;password=MyPassword;initial catalog=DbName;workstation id=PC1"
OleDb connection string:
"provider=SQLxxxx;data source=MyRemoteServer;user id=MyUserID;password=MyPassword;initial catalog=DbName;workstation id=PC1"
(xxxx = I forget the exact provider string)
OleDb connects fine, SqlClient times out looking for the server?
Am I missing something obvious? Should I really worry about this - I thought SqlClient was faster and better?
Thanks
Ian
|
|
|
|
|
Did you get this to work?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi ,
All my fellow Iranians , Please Vote for this!
https://connect.microsoft.com/Connect/feedback/ViewFeedback.aspx?FeedbackID=307273
|
|
|
|
|
You should learn how to do a clickety link here on CP (it will keep people from having to copy the URL and paste in the address bar). Highlight the URL and press Ctrl+L
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hello. I have a very basic question (at least for most of you pros out there ). Are stored procedures executed in isolation - meaning that, while one SP is being executed no other SP or query can execute on the same record.
More specifically I would like to know if there is a chance that during the execution of the below SP the value of @@ROWCOUNT can be changed on line 16 by another SP or query (in which case the below SP is under the risk of returning a wrong value).
1: CREATE PROCEDURE ProductsUpdate
2: (
3: @ProductID int,
4: @Name varchar(40),
5: @Concurrency timestamp
6: )
7: AS
8: UPDATE
10: Products
11: SET
12: ProductName = @Name
13: WHERE
14: ProductID = @productID AND
15: Concurrency = @Concurrency
16: -- Is it possible to have another SP or query change @@ROWCOUNT at this point?
17: return @@ROWCOUNT
Also I was wondering about the same question but with generic queries, like below:
1: UPDATE
2: Products
3: SET
4: ProductName = @Name
5: WHERE
6: ProductID = @productID AND
7: Concurrency = @Concurrency;
8: -- Can any other query or SP get in here and alter @@ROWCOUNT?
8: SELECT @@ROWCOUNT
Thank you for your help .
Niaher
-- modified at 10:52 Tuesday 30th October, 2007
|
|
|
|
|
Hi Niaher
The @@ROWCOUNT variable (and others like @@ERROR) are local to each database connection. Your stored procedure can use this to implement concurrency control.
Regards
Andy
|
|
|
|
|
Thank you. So what about a generic query with multiple statements, does it have a single connection? Can I use them to implement my concurrency control?
|
|
|
|
|
Yes you can use them for concurrency control. Which development language are you using?
|
|
|
|
|
Using C#. Btw I know it is a very controversial question, but what is a better choice performance-wise, a stored procedure or a dynamic query? In my case I will have not more than 15 tables and my goal is to support concurrecy in insert, update and delete logic, be it in SPs or dynamic queries.
Niaher
|
|
|
|
|
You're right - it is a very controversial question
Performance should be very similar for this type of logic - SQL-Server will cache query plans for both methods.
Stored procedures encourage:- Encapsulation of data-access logic - so you can substantially change the underlying SQL at a later date.
- Better security - You can deny direct access to the database tables, and force all access via the stored procedure layer.
- Reduced susceptablity to SQL-Injection attacks.
The downside is that you need to write more code, and many programmers don't like writing SQL.
I normally use Stored Procedures in my projects (because I tend to work for clients whose the coding standards dictate that they should be used). I normally write code generators to do the boring stuff for me.
Regards
Andy
|
|
|
|
|
i have a DTs that has steps, collecting info from Different tables and recreate a temp table for reporting. When i execute this DTS that has steps, i get the Error
"Execution Canceled by user"
and i did not cancel it.
Please help
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
|
Thanks it worked for me
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
HTH!
Raz
/*
Ghazi Hadi Al Wadi, PMP, ASQ SSGB, DBA
*/
|
|
|
|
|
hi....
Now displaying date like 10-2007 but I want to display Oct-2007.in Sql Query..anybody know plz reply me..
Rajendran
|
|
|
|
|
Try This,
select convert(varchar(50),getdate(),106)
|
|
|
|
|
hi soni Uma....Thanks for reply.....
I want to display only the month and year..(Oct-2007) if u know that plz reply me..
see the following code...thats i have used...but its displaying 10-2007....
select Cast(DatePart(month,RenewalBaseMonth) as varchar) + '/' +Cast(DatePart(year,RenewalBaseMonth) as varchar) as RenewalBaseMonth
from #temp21
Thanks
Rajendran
|
|
|
|
|
Hi,
Try this
select Cast(DateName(month,RenewalBaseMonth) as varchar(3)) + '/' +Cast(DatePart(year,RenewalBaseMonth) as varchar) as RenewalBaseMonth
from #temp21
Senthil
-- modified at 8:15 Tuesday 30th October, 2007
|
|
|
|
|
hi,
Its working fine....
Really good work and thanks alot....
Rajendran
|
|
|
|
|
Pls rate my answer if it is working well
Senthil
|
|
|
|
|
May I know where u r working..If u feel good tell me.
Thanks..
Rajendran
|
|
|
|