|
OK - I got a 1 for helping you because ?
The books online and google explain how to write a trigger. I'd help more, but then I'd just get another one vote for my trouble.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
WASTEEEEEEEEEEEEEEEEEEEEE
|
|
|
|
|
I'm sorry, when I get a 1 for trying to help, on the basis that people can't do any work for themselves, I stop helping.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Me too.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Yup. Judging by your responses, Christian is most definitly wasting his time on you.
|
|
|
|
|
What makes you think demanding code and a response like this will ever get you help here or anywhere else in the world???
|
|
|
|
|
Hi all, I want to load a database column to a dropdownlist.So how to load data to dropdownlist?
DB is MSSQL 2005
Language is C#
thanks
CheeN
|
|
|
|
|
select myCol from myTable and then bind the resultant datatable to the control. You can also set the display and data member if you want, you'll need to do this if you select more than one column.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi guys
I need to implement real time data sync of 2 dbs in two different geographical locations. Any ideas (A-Z step by step) on how to implement this? I dont know much about database administration but I am willing to learn.
Thanks in advance
|
|
|
|
|
Well... let's start with what type of databases? SQLServer, etc.
Second, how 'real time' do you want the replication to be? Immediate? Seconds? Minutes?
Tim
|
|
|
|
|
Hi Tim,
Thanks for the reply.
Im looking at sql server 2005 db.
we are still deciding whether it should be immediate or 2 minute intervals
lets go with worst case - immediate - for now
|
|
|
|
|
i was trying to add the column names in the existing table using the stored procedure in sql server 2000.
My stored procedure is
CREATE PROCEDURE [dbo].[spInsert_Master] <br />
<br />
AS<br />
declare @les varchar(1000)<br />
<br />
delete tblmaster<br />
create table tblMaster(categoryname varchar(100) , casestudy varchar(100) , UnitInformation varchar(100) , locationname varchar(100)) <br />
declare les cursor for select lessonname from tblLessonMaster<br />
open les<br />
fetch next from les into @les<br />
while(@@fetch_status =0)<br />
begin<br />
fetch next from les into @les<br />
alter table tblMaster add @less varchar(500);<br />
select @les as lessonname<br />
end<br />
close les<br />
deallocate les
I got the error in the following line
alter table tblMaster add @less varchar(500);
says error near @less
i think i can't add the @ expression in the column name.
any idea for the alternative ?
I want to add the column names in the existing table using stored procedure.
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
try replacing this line
alter table tblMaster add @less varchar(500);
with
SET @Str = 'alter table tblMaster add ' + @less ' varchar(500);'<br />
Exec (@Str)
also need to declare @Str variable at the begining
Regards
KP
|
|
|
|
|
how can i check duplicate column names exist or not in the table?
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
in SQL 2000 syscolumns contains all column names of each table and sysobjects contains all table names
Value 'U' in the column sysobjects.xtype indicates the objects is user table
id column in both tables are common which to be used for joining the two tables.
Regards
KP
|
|
|
|
|
can u tell me a query which gives me the result regarding ,whether the particular column name already exist or not in the table?
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
Assuming SQL Server 2000
if exists (select 1 from syscolumns where name = 'yourcolumnname' and id = object_id('yourtablename')<br />
begin<br />
select 'It exists'<br />
end<br />
else<br />
begin<br />
select 'its new'<br />
end
this will also work with SQL Server 2005 but you should be using the sys.xxx views
Bob
Ashfield Consultants Ltd
|
|
|
|
|
i have a table which has large amount of data.
My job is
1. Move all the data into another table which is available in different server.
2. Creating index (Clustered index)
Now i want to know when i have to create index? before insert or after insert
Right now i am following after insert, i am creating index.
Please anyone let me know about this...,
D.Willington
|
|
|
|
|
Hi,
Based on what you have described. It would be better if you create index before insert the reason being is that when a query uses a nonclustered index, it can use the index efficiently to find the rows. However when it has to go back to the clustered index for any additional columns not present in the nonclustered index (that is called a "lookup").
Lookups can be expensive, especially if needs to do them for a lot of rows -- so extremely narrow nonclustered indexes tend to be limited use except when you're only working with a single column (or the indexed column and the clustered index columns -- keep in mind that nonclustered indexes include the table's clustering key at the leaf level).
Hope this will help you in moving forward in your task .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Create the clustered index first.
Inside the stored procedure that populates the table with the inserts sort the data in the same order as the clustered index.
This is because the clustered index will have to do a lot of page splits if you just throw all that data at it in any order (depending on how many rows you have).
Clustered indexes are primarily of use for OLAP data - so don't go crazy with them if the data is for OLTP...
Regards
Guy
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
|
|
|
|
|
I have a stored procedure that returns the max. number of publication views by author. I will not pass the author name, my stored procedure will select the top 1 like here.
SELECT DISTINCT TOP 1
dbo.FnGetNoOfPublicationViewsByAuthor(C.CUSTOM2) AS 'TotalPublicationsViews',
C.CUSTOM2 AS 'Author'
FROM HDS_CUSTOM C
GROUP BY C.CUSTOM2
I want to get the value of this Author seperately to use in other select statements in the same SP. how can I get it. Is there possibility?
Thanks.
|
|
|
|
|
<br />
DECLARE @TotalPublicationsViews AS VarChar(100)<br />
DECLARE @Author AS VarChar(100)<br />
<br />
SELECT DISTINCT TOP 1<br />
@TotalPublicationsViews = dbo.FnGetNoOfPublicationViewsByAuthor(C.CUSTOM2),<br />
@Author = C.CUSTOM2 <br />
FROM HDS_CUSTOM C <br />
GROUP BY C.CUSTOM2<br />
<br />
SELECT @TotalPublicationsViews, @Author<br />
Declare variables as per their respective DataTypes
Regards
KP
|
|
|
|
|
hi friends
How to disable password complexity check while creating a new user.here I am getting the error message " The password does not meet Windows policy requirements because it is not complex enough".I want to disable this check.I used the script "EXEC dbo.sp_grantdbaccess @loginame = N'name', @name_in_db = N'name'" for creating user.
Thanks in advance
thomas
|
|
|
|
|
You can't disable it. This is a policy that is enforced on either the server (the entire Windows server) or domain wide, not just SQL Server. There is no way to disable this policy just to add a user and turn it back on.
|
|
|
|