|
Do Subsonic Generates Stored Procedure for US?
Is there any version of subsonic that do this?
If yes How?
Thanks.
|
|
|
|
|
WHy not try the Subsonic web site? I bet they know.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hello,
I have some problem with search a skills like c, c#, etc. by using Containstable .
My host provider does not change noise words. Due to this we are using below quarries
If users searching a keyword like C, then query is as follows…
select id,skills,[state],metroarea,designation,cname,jobtype,city,rank FROM peoplesurge_posting as posting INNER JOIN
containstABLE(peoplesurge_posting,(skills,[state],metroarea,designation,cname,jobtype,city),'ISABOUT ("c*")') as frees ON frees.[key]= posting.[id]
Note: 'ISABOUT (C)' for this it takes as a noice word then no rusults were displayed. Due to this we adding * to keyword c. this querry gives some results but it gives wrong results i.e starting character of C
Like c, c++, c#......etc
Please resolve this problem ASAP. It’s very urgent for me.
Thanks,
Satish.
|
|
|
|
|
|
Hi Everyone.
I have a relative simple question. I want to load an image into a SQL 2005 Database, but I dont want to write a program to do this. Is there any way that I will be able to upload the image into SQL without a Windows/Web application? Purely in SQL itself?
Your help will be greatly appreciated. I know it's properly a simple question, but I am looking for a shortcut
Kind Regards,
Elizma
|
|
|
|
|
Have a look at UPDATE[^] statement's WRITE method if you have varbinary column. Otherwise see WRITETEXT[^].
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hi all,
I am doing a project in .net 2.0 which consists of both win forms and web forms. For web application i am using sql server 2005 and for win forms i am going to use msde. Both msde and sql server 2005 contains same databse structure. I have to flush the data from local msde to the web server. Could any one please tell me the idea to implement this?
Thanks.
|
|
|
|
|
|
Hi all,
Where can I download SQL Server 2000 Books Online (SQL BOL)? for query help ?
Best regards
rameez
|
|
|
|
|
|
I use the SQL SERVER2000. My program is to check the present of the employees, then write the record to the sheet.I will give him/her a tip if he/she has signed today,then I would not write this record to the sheet. How I konw he/she has signed today? Query the large record sheet every time? I think It is time consuming.Is there a better solution?
|
|
|
|
|
If you have recorded logins to a table, add a column for sign-in time. Then use that column in your query to restrict rows to today's information. Also add an index containing both username (or whatever is the column you use to identify the user) and sign-in date.
Also you could delete older rows once in a while.
Another option is only to record the last login date to the table containing user information (update the row and set last login date to getdate()). When you fetch info about the user, check if the last login date is today or earlier.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hi all,
i have stored date as varchar(30) data type and Date format is dd/MM/yyyy now i have to convert it into datatime data type can u help me in query ?
i have 330 records and each recod contain the Date in format of dd/MM/YYYY but due to varchar data type i can not perform calculation on Date so i have to convert into datetime without data lose.
please help me in this regard.
Best Regards
Rameez
|
|
|
|
|
|
This question is related to the performance of using Stored Procedure OR Views in the following scenario.
We are building an application for Multiple Organizations (Tenants) and using the Shared Database approach for maintaining the data. So Every Table in our database will have TenantId column. Sample Table is shown here:
CREATE TABLE [ent].[tbl_NetworkProfileTemplate](
[PK_NetworkProfileTemplateId] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
[ProfileTemplateName] [nvarchar](20) NOT NULL,
[ProfileTemplateDescription] [nvarchar](255) NULL,
[FK_TenantId] [int] NOT NULL,
CONSTRAINT [PK_tbl_NetworkProfileTemplate] PRIMARY KEY CLUSTERED
(
[PK_NetworkProfileTemplateId] ASC,
[FK_TenantId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [TenantPScheme]([FK_TenantId])
)
Now I want to Protect (filter) the data at the database level: If User belonging to Tenant Id =1 logins into the application that user will see records only for that Tenant. And I want this filtration of data at the Database level so developers writing the code in the business layer doesnot need to worry about the filtration of data.
So there are possibly two solutions for this
1. Create stored procedures for each table to fetch, insert, delete and update the records. The logic in the stored procedure will filter the records based upon the Connection with the Database. (Each Tenant will have separate database User)
2. Create views of each table that will filter out the records based upon the Connection with the database.
Create VIEW [ent].[vw_NetworkProfileTemplate]
AS
SELECT
*
FROM [ent].[tbl_NetworkProfileTemplate]
WHERE FK_TenantId= system_user
I see lot of advantages of using views in my applications
Many applications these days are created where we write inline queries and stored procedures also, so using views does not effect our development of Middle layer too much. Also these days we are using OR Mapper tools so this will be helpful in case of views but not in stored procedures approach.
Some of my company DBA’s told me that there is considerable performance hit and scalability issues when using Views, so use Stored procedures. I did some research on that and see the execution plan for the various queries like fetching the data from these tables using joins with other tables etc. but execution plan is exactly same.
My question is that the view which I have created above is slower or have scalability issues compared to using the stored procedures?
Please answer by looking by my View. This view is very simple and have only one where clause in it.
|
|
|
|
|
Since you have to execute the select statement somewhere, view is not a bad option at all. Basically it's only a stored version of the statement. If you compare the same query inside a view or stored procedure, there's no difference in execution. However, if stored procedure is created using cursors, the stored procedure will be much slower and inefficient.
If you build complex queries over the view, there may be problems for the optimizer to find a good plan. For example, so called predicate pushing may not always be possible. For this reason most of the logic in the statement should be put into the query in the view (if possible).
Another area you should consider is data modifications. Fetching the data through a view is a simple and efficient process, but how are the modifications done. Is the application executing delete, insert and update against the view or do DML statements use another path to the data. When using views there are lots of restrictions that cause the view not to be updatable anymore. For example, joining in view and deleting against the view. Should all the rows be deleted in joined tables or not. You can use INSTEAD OF triggers to overcome these limitations.
Hope this helps,
Mika
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Thanks Mika.
Yes we can use Instead of Triggers where we face problems in delete/ update statements. But I got the idea from your answer that using views doesnot impact any performance as I have to issue the select statement either in Stored Procedure or View.
|
|
|
|
|
No problem
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
i need a sample project as an example of inserting data in a sql database using t-sql on visual studio in webset using asp.net and the form contain textboxs which has the fields of the inserted data ...and it get's inserted into a table in the database
something like registration form
i hope you can help me ... thanks for reading
|
|
|
|
|
Write your code, and if it doesn't work post it here and someone will help you. There are literally thousands of examples both here on CP and Google.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi all,
i would to embed my database file(mssql 2005 express) in my exe file. can any one suggest me the way how i do this.
thanks in advance.
rmshah
Developer
|
|
|
|
|
You can't. SQL server need exclusive access to it when it is running as a database.
|
|
|
|
|
|
Hay ..
in SQL server 2005
I can make any select statement , but how can I get the last record :
like that
id invNo
1 a1
2 a2
3 a3
<br />
@newinv nvarchar(10) output<br />
AS<br />
SET NOCOUNT ON<br />
begin<br />
SELECT * FROM table ORDER BY invNo<br />
end<br />
<br />
I want to get the field invNo of the last record then by substring function i can add One ..
I hope my question is clear .
thanks
jooooo
|
|
|
|
|
select top 1 invNo from table order by id desc
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.
|
|
|
|