So you need to determine some actual implementation cases where it is reasonable.
It is also ok, to write them to the database tables if possible.
Still depends on what you mean by error.
It is certainly possible for some cases.
Also why is this just a database relevant question? If the system is large then there will be other parts of the system which will fail in relation to the database. For example bouncing the database is very likely to cause ripple failures in a 24x7 system unless those other systems are specifically designed to deal with that.
One might think that they could put that in every proc as thus record errors but I am rather certain that in many procs the errors that might occur would be the ones that would be compounded by attempting another write to the database. For example a table space error.
I want to pass the sort as an input parameter to the stored proc.
I am constructing a dynamic sql and executing it. The problem is more like a syntax issue, where in I an checking for certain value in sql.
Set @sql1 = '
set @sql1 = @sql1 + ' ' + @sort
How would I check for additional conditions in this sql? I tried to enclose N in double still did not work.
Customer => Customer details
=> Coloums are Customer Name, Customer Type (Gold, Silver, Platinum) Contact => Can have multiple contacts to a customer
=> Coloums are Customer Id, Name, email, Designation (D1 to D10).
we need to create an SP (MS SQL 2005 ) which returns priority 1 and priority 2 emails of customer (Customer Id will be passed as input) based on following criteria .
When Customer Type is "Gold" Customer, choose email based on following Designation
1. D1, D3,
2 D4, D6
3, D5, D7, D8
a). if D1 exist select D1 and move to set 2,
D1 NOT exist select D3 and Move to set 2
D3 NOT exist move to set 2
b) if D4 exist select D4 and move to set 3,
D4 NOT exist select D6 and Move to set 3
D6 NOT exist move to set 3
Note : if we got an email in first step and this step retun two emails. No need to iterate step 3
c) reapeat above logic with step 3 designations sequentially
Continue searching until we get 2 mails.
For "Silver" Customer choose email based on following designation
1. D1, D2,
2 D6, D7
3, D8, D9, D10
For "Platinum" Customer choose email based on following designation
1. D1, D2,
2 D8, D9
3, D3, D4, D10
I am not sure i explained logic very well. Is there any algorith for this type of logic.
Create a bridge table between CustomerType and EmailDesignation and fill it with data that represents the relationship you specified above. You can then create a query that joins these three tables to get the data that you require.
You also need to create a new table with email designations and their priority.
SELECTTOP2 C.CustomerName, Co.CustomerType, E.Email, E.Designation
FROM Customer C
INNERJOIN CustomerEmailBridge B ON C.CustomerType = B.CustomerType
INNERJOIN Email E ON B.EmailDesignation = E.EmailDesignation
INNERJOIN EmailPriority P ON E.EmailDesignation = P.EmailDesignation AND B.CustomerType = P.CustomerType
WHERE (C.CustomerID = @CustomerID)
I connected two computers in LAN 1st having IP 192.168.1.1 and 2nd having IP 192.168.1.2 and i am having sql server management studio express 2005 installed on 1st computer now when i run exe from 192.168.1.2 it throughs an error like.
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
where as it runs perfetly on 1st computer.
my conection string is
Public DBConn As ADODB.Connection
DBConn.ConnectionString = "Provider=MSDATASHAPE; Data Provider=SQLOLEDB.1;Data Source=TOSHIBA\SQLEXPRESS; Initial Catalog=" & App.Path & "\AVON_AIR_Data.mdf; User ID=sa; Password=; Integrated Security=SSPI; Persist Security Info=False;"
For remote connections, the Initial Catalog attribute must specify the database name alone, you cannot attach a local database. And the other problem is, you can either specify Integrated Security or User ID/Password, but not both.
Can any one explain how i could use Dynamic SQL using SSIS Datareader Like for
Oh this is a fun one; you will need a variable and build the syntax of your query in an expression. Then in the 'data flow', 'source editor' change, 'data access mode' to 'SQL Command from variable. It can be done, just take a little bit of creativity.
Common sense is admitting there is cause and effect and that you can exert some control over what you understand.
Last Visit: 31-Dec-99 18:00 Last Update: 15-May-21 21:05