You need to write a procedure for getting your required output
Regards KP
You need to write a procedure for getting your required output
Regards KP
this can be done using either with Check Constraint or Trigger
Regards KP
check this for more details on Maximum Capacity Specifications for SQL Server 2005 http://msdn.microsoft.com/en-us/library/ms143432.aspx[^]
Regards KP
Can be done only using corelated subqueries
SELECT Distinct SalesID FROM fky a WHERE
EXISTS (SELECT * FROM fky b WHERE a.SalesID = b.SalesID AND fkey = 12345)
AND
EXISTS (SELECT * FROM fky c WHERE a.SalesID = c.SalesID AND fkey = 775)
Regards KP
Use Convert or Cast functions
SELECT Convert(VarChar(10), IntValue) + VarcharValue .....
SELECT Cast(IntValue, VarChar(10)) + VarcharValue .....
in the example I've used 10 characters i.e. max 10 degit number
Regards KP
Yes. This usage is porper, to check for multiple columns.
Regards KP
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
try replacing this line alter table tblMaster add @less varchar(500);
with SET @Str = 'alter table tblMaster add ' + @less ' varchar(500);' Exec (@Str)
also need to declare @Str variable at the begining
Regards KP
DECLARE @TotalPublicationsViews AS VarChar(100) DECLARE @Author AS VarChar(100) SELECT DISTINCT TOP 1 @TotalPublicationsViews = dbo.FnGetNoOfPublicationViewsByAuthor(C.CUSTOM2), @Author = C.CUSTOM2 FROM HDS_CUSTOM C GROUP BY C.CUSTOM2 SELECT @TotalPublicationsViews, @Author
Declare variables as per their respective DataTypes
Regards KP
From SQL Enterprise Manager, select your server instance and go to Management -> SQL Server Agent -> Jobs right click "New Job" write your SQL query under "step" then schedule the job
Regards KP
Create a job to fetch all rows from first table that matches to the current date and copies to second table Schedule the job to execute daily
Regards KP
SELECT ColA, Count(*) FROM TblA GROUP BY ColA
Regards KP
column name Guest ID is having space so it cannot be used directly use it like this command = "INSERT INTO Guest([Guest ID]) VALUES('1111')"
Regards KP
Check whether column yield contains any -ve value this might result in domain error
Regards KP
DATEPART() function should solve your problem Ex. WHERE DatePart(wk, Convert(DateTime, ColA)) = DatePart(wk, Convert(DateTime, getdate())) AND Year(ColA) = Year(GetDate())
Regards KP
UPDATE TableA SET ColA = NULL WHERE LEN(ColA) = 0 this works for string data
even recollect reading IsEmpty() function in SQL Server you may even try with this. I've never used this function.
Regards KP
UPDATE SET = NULL WHERE LEN() = 0
this works for string data even recollect reading IsEmpty() function in SQL Server you may even try with this. I've never used this function.
Regards KP
Getting End Date 1. Add 1month to the given date taking 1st day and year of given date 2. which returns 1st of next month from given date 3. subtract 1day which returns last day of given month DECLARE @GivenDate AS DateTime SET @GivenDate = GetDate() SELECT DateAdd(DD, -1, DateAdd(MM, 1, Cast(Month(@GivenDate) AS VarChar(2)) + '/01/' + Cast(Year(@GivenDate) AS VarChar(4))))
Getting Start date similar to the end date take day as 1 with month & year from given date
Regards KP
Try creating a job. so that the same will be executed at server and need not have an active connection from client.
Regards KP
hi 123, excle file should have sheet with name "sheet1" i.e. excluding $ sign.
Regards KP