|
I generally find SQL Server Books OnLine is an ideal place to start with help with SQL Server but that is just me.
|
|
|
|
|
Yeah, but I'm under the impression that in version 2000 the identity can only be disabled. Constraints can be dropped, but is identity modelled as constraint in 2000? Didn't find any clear answer for that.
The need to optimize rises from a bad design
|
|
|
|
|
I have a 'product' table, with an integer foreign key into a 'productLine' table. I populate a Products menu with one child item for each product line, and when that menu item is clicked, an image gallery for that product line opens. My issue is that I need the product line name on the gallery page, so I must either pass the productLineId in the url, and use it as a filter parameter in my product image query, and perform a separate lookup to get the product line name, or join the two tables, and pass the product line name as part of the url. I don't feel comfortable with using the join only for this reason. What are the general opinions on a matter like this?
|
|
|
|
|
Personally, unless there is a very good reason not to, I would pass the name and id. You need the id to look up the images, but database access is relatively expensive so I would avoid the round trip just to get the name.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Ashfield wrote: I would avoid the round trip just to get the name.
I'm already avoiding the round trip by using a denormalised view, where each product record includes the product name view.
|
|
|
|
|
Well there you go, you are doing it the way I would.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
How many of these lookups do you have? It seems likely your data layer would be caching them anyway...
|
|
|
|
|
I have file in macro word name : Dataku.
is anybody could tell me, how to execute that file from sql 2005.
Thanks before.
irvinia
|
|
|
|
|
irvinia wrote: I have file in macro word name : Dataku.
is anybody could tell me, how to execute that file from sql 2005.
Are you saying you want to run a macro in MS Word from within your database? I don't think that is possible...
|
|
|
|
|
Yes, i want to run macro in MS Word from database, and maybe that's not possible. ok, i will try looking for other way.
thank u for your replay, ChandraRam
|
|
|
|
|
If you're trying to use the article you mentioned before(www.codeproject.com/KB/miscctrl/data_dictionary.aspx[^]), the idea is that you place the macro in a new Word document (using macro editor), modify it and run it.
If it is something else you're after, please describe with more details.
The need to optimize rises from a bad design
|
|
|
|
|
Thank you for your replay.
i just try to change that code from that site to sql statement (maybe it's not simple), because i'm looking for the same method but with different language.
anyway, thanks again, Mike. i will looking for other way...
|
|
|
|
|
hi all,
i simply write a small code of piece which create backup of Sql server database. It works well but whenever i set the target path of back file to Desktop( or program files folder) then it gives following error
"Can not open backup device" & Target Path & ". Operating system error 5(Access is denied) /or Operating system error 3(Error not found).
Any body can help me to resolve this error ?
|
|
|
|
|
Hi Rupesh,
The backup crated by the sql server can be stored only on the machine where the SQL server is installed. Just create a folder in SQLServer and give full permission to this folder and then try to create the backup. I hope it will work.
Thx
|
|
|
|
|
hi all,
In my application i hav a search page.
I have a table with 5 Columns..
Columns are:
p_id,p_code,p_bedNumber,p_bathNumber,p_price
Table:
p_id p_code p_bedNumber p_bathNumber p_price
1 a1 2 3 100000
2 a2 3 4 210000
3 a3 2 1 12000
the search parameter may containe multi valuese for @p_bedNumber
ie. @p_bedNumber='3,4'
i want to display all records which has 3 or 4 in p_bedNumber column.
In this case only return 1 record..
I 'm looking to write a procedure plz help
|
|
|
|
|
Ha_80 wrote: the search parameter may containe multi valuese for @p_bedNumber
ie. @p_bedNumber='3,4'
i want to display all records which has 3 or 4 in p_bedNumber column.
try following where clause in query
where @p_bedNumber in ('3','4')
hope this helps
|
|
|
|
|
select * fro mytable where (p_bedNumber = 3) or (p_bedNumber = 4)
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
SELECT
column1,
column2,
if (column3 = 0)
begin
'Z',
end
else
begin
'C',
end
FROM table1
Is it possible that i can do it this way?
KaKaShi HaTaKe
|
|
|
|
|
Now, a question for YOU. Which takes longer, typing it in to CP and waiting for a reply, or typing in into query analyser and running it?
A clue, try the CASE statement.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Ashfield wrote: A clue, try the CASE statement.
A fine clue, that is
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
explain your self!!!!
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
SELECT
column1,
column2,
CASE
WHEN (column3 = 0)
THEN 'Z'
ELSE 'C'
END
FROM table1
-------------
Mostafa Noor
Egypt
|
|
|
|
|
Hi there,
I think you might want to use a CASE statement. Not sure which database system you are using but it would look something like this...
SELECT
column1,
column2,
CASE column3 WHEN 0 THEN 'Z' ELSE 'C' END
FROM table1
Cheers,
Kevin
|
|
|
|
|
Hi all,
i am still new in sql. i have problem now, how to generate database (
· Table Column Details
· Indexes
· Views
· Stored Procedures
· Functions
· Triggers
· Primary Keys
· Foreign Keys
· Default Constraints
· Identity Columns
, etc) to word.
once, i have the code from this site (and that's really good), but using macro in word. i have problem for convert to sql. www.codeproject.com/KB/miscctrl/data_dictionary.aspx
please help me, anybody...
thank before..
irvin
|
|
|
|
|
In order to help you, you should specify, what is the problem you're experiencing. If it's an error message, post the actual message you get.
The need to optimize rises from a bad design
|
|
|
|