User talk:Rajubaladaniya

hiiiiiiiiiiiiiiiiiiii

sql parameter for c#
List sqlPara = new List;

sqlPara.Add(new SqlParameter("@ID", objinvHeader.ID)); sqlPara.Add(new SqlParameter("@ParentID", objinvHeader.ParentID)); sqlPara.Add(new SqlParameter("@JobID", objinvHeader.JobID)); sqlPara.Add(new SqlParameter("@InvoiceNo", objinvHeader.InvoiceNo)); sqlPara.Add(new SqlParameter("@InvoiceDate", objinvHeader.InvoiceDate)); sqlPara.Add(new SqlParameter("@InvoiceTypeID", objinvHeader.InvoiceTypeID));

sqlPara[0].Direction = ParameterDirection.InputOutput;

SqlHelper.ExecuteDataset(ConfigurationHelper.ConnectionString, CommandType.StoredProcedure, "InvoiceOperation", sqlPara.ToArray); return Convert.ToInt32(sqlPara[0].Value);

https://developers.google.com/api-client-library/dotnet/apis/ https://developers.google.com/api-client-library/dotnet/apis/ https://www.programmableweb.com/api/google-custom-search/sample-source-code https://developers.google.com/custom-search/json-api/v1/libraries https://stackoverflow.com/questions/22223146/is-there-a-working-sample-of-the-google-custom-search-rest-api http://codigogenerativo.com/code/google-custom-search-api/ https://www.programmableweb.com/api/google-custom-search

Declare @SearchStr nvarchar(100) = '180001'

CREATE TABLE #Results (ColumnName nvarchar(370), ColumnValue nvarchar(3630))

SET NOCOUNT ON

DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110) SET @TableName = '' SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%',)

WHILE @TableName IS NOT NULL

BEGIN SET @ColumnName = '' SET @TableName = (           SELECT MIN(QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME))            FROM     INFORMATION_SCHEMA.TABLES            WHERE         TABLE_TYPE = 'BASE TABLE'                AND    QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME) > @TableName                AND    OBJECTPROPERTY( OBJECT_ID(                           QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME)                             ), 'IsMSShipped' ) = 0       )

WHILE (@TableName IS NOT NULL) AND (@ColumnName IS NOT NULL)

BEGIN SET @ColumnName = (               SELECT MIN(QUOTENAME(COLUMN_NAME))                FROM     INFORMATION_SCHEMA.COLUMNS                WHERE         TABLE_SCHEMA    = PARSENAME(@TableName, 2)                    AND    TABLE_NAME    = PARSENAME(@TableName, 1)                    AND    DATA_TYPE IN ('char', 'varchar', 'nchar', 'nvarchar', 'int', 'decimal')                    AND    QUOTENAME(COLUMN_NAME) > @ColumnName            )

IF @ColumnName IS NOT NULL

BEGIN INSERT INTO #Results EXEC (                   'SELECT  + @TableName + '.' + @ColumnName + , LEFT(' + @ColumnName + ', 3630)                     FROM ' + @TableName + ' (NOLOCK) ' +                    ' WHERE ' + @ColumnName + ' LIKE ' + @SearchStr2                ) END END END

SELECT ColumnName, ColumnValue FROM #Results

Drop table #Results

https://www.mssqltips.com/sqlservertip/1599/sql-server-cursor-example/

DECLARE @A NVARCHAR(MAX) = '', @b BIGINT = 0

SELECT ROW_NUMBER OVER(ORDER BY TABLE_CATALOG) As R_Num, 'SELECT * FROM '+TABLE_CATALOG+'..'+TABLE_NAME+' WHERE '+COLUMN_NAME+' LIKE %India%' FROM INFORMATION_SCHEMA.COLUMNS WHERe DATA_TYPE IN ('text','varchar','nvarchar')

CREATE TABLE #FoundTable (N NVARCHAR(2500)) DECLARE @TableName  varchar(50), @ColumnName  varchar(50), @TABLE_CATALOG  varchar(50), @ValueToFind varchar(100) = 'India'

DECLARE @DBname NVARCHAR(Max)= '' (Select name Into #T from sys.databases WHERE name NOT IN ('master','model','msdb','tempdb'))

DECLARE @DBcount INT = (Select Count(*) from #T)

WHILE (@DBcount > 0) BEGIN

SELECT ROW_NUMBER OVER(ORDER BY TABLE_CATALOG) As R_Num, TABLE_CATALOG AS TC, TABLE_NAME, COLUMN_NAME INTO #A FROM INFORMATION_SCHEMA.COLUMNS WHERe DATA_TYPE IN ('text','varchar','nvarchar') AND TABLE_CATALOG = @DBname

DECLARE @I INT = (SELECT Count(*) FROM #A)

WHILE (@I > 0) BEGIN SELECT @TableName = TABLE_NAME, @ColumnName = COLUMN_NAME, @TABLE_CATALOG = TC		 FROM #A WHERE R_Num = @I

DECLARE @SQLCommand NVARCHAR(4000) = '' SET @SQLCommand = 'INSERT INTO #FoundTable ' +' SELECT  + @TABLE_CATALOG+' '+@TableName +  FROM ['+@TABLE_CATALOG+']..'+@TableName+' WHERE ['+@ColumnName+'] LIKE %India%' PRINT @SQLCommand EXEC(@SQLCommand)

SET @I = @I - 1 END

DROP TABLE #A

SET @DBcount= @DBcount - 1 END

SELECT * FROM #FoundTable DROP TABLE #FoundTable DROP TABLE #T --SELECt * FROM sys.databases

CREATE TABLE #FoundTable (N NVARCHAR(2500)) DECLARE @TableName  varchar(50), @ColumnName  varchar(50), @TABLE_CATALOG  varchar(50), @ValueToFind varchar(100) = 'India'

Select ROW_NUMBER OVER(ORDER BY name) As R_Num, name Into #T from sys.databases WHERE name NOT IN ('master','model','msdb','tempdb')

DECLARE @DBcount INT = (Select Count(*) from #T)

WHILE (@DBcount > 0) BEGIN DECLARE @DBname NVARCHAR(Max)= (SELECT name FROm #T WHERE R_Num = @DBcount) PRINT @DBname SELECT ROW_NUMBER OVER(ORDER BY TABLE_CATALOG) As R_Num, TABLE_CATALOG AS TC, TABLE_NAME, COLUMN_NAME INTO #A FROM INFORMATION_SCHEMA.COLUMNS WHERe DATA_TYPE IN ('text','varchar','nvarchar') AND TABLE_CATALOG = @DBname

DECLARE @I INT = (SELECT Count(*) FROM #A)

WHILE (@I > 0) BEGIN SELECT @TableName = TABLE_NAME, @ColumnName = COLUMN_NAME, @TABLE_CATALOG = TC		 FROM #A WHERE R_Num = @I

DECLARE @SQLCommand NVARCHAR(4000) = '' SET @SQLCommand = 'INSERT INTO #FoundTable ' +' SELECT  + @TABLE_CATALOG+' '+@TableName +  FROM ['+@TABLE_CATALOG+']..'+@TableName+' WHERE ['+@ColumnName+'] LIKE %India%' PRINT @SQLCommand EXEC(@SQLCommand)

SET @I = @I - 1 END

DROP TABLE #A

SET @DBcount= @DBcount - 1 END

SELECT * FROM #FoundTable DROP TABLE #FoundTable DROP TABLE #T --SELECt * FROM sys.databases

---

DECLARE @db_name TABLE(R_DB int, dbname VARCHAR(1000)) DECLARE @tbl_name TABLE(R_T int, dbname VARCHAR(1000), tblname VARCHAR(1000), colname VARCHAR(1000), datatype VARCHAR(1000))

DELETE FROM @db_name DELETE FROM @tbl_name

INSERT INTO @db_name SELECT ROW_NUMBER OVER(ORDER BY name) AS R_DB, name FROM sys.databases

DECLARE @db_count int = (SELECT COUNT(*) FROM @db_name) WHILE (@db_count> 0) BEGIN

DECLARE @vdbname varchar(100) = (SELECT dbname FROM @db_name WHERE R_DB = @db_count) INSERT INTO @tbl_name EXEC('USE ['+@vdbname+'] SELECT ROW_NUMBER OVER(ORDER BY TABLE_CATALOG) AS R_Num, TABLE_CATALOG, TABLE_NAME, COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE DATA_TYPE IN (varchar, nvarchar, text)')

SET @db_count = @db_count -1 END

SELECT * FROM @tbl_name

DECLARE @db_name TABLE(R_DB int, dbname VARCHAR(1000)) DECLARE @tbl_name TABLE(R_T int, dbname VARCHAR(1000), tblname VARCHAR(1000), colname VARCHAR(1000), datatype VARCHAR(1000), queries VARCHAR(4000), ccount INT)

DELETE FROM @db_name

INSERT INTO @db_name SELECT TOp 1 ROW_NUMBER OVER(ORDER BY name) AS R_DB, name FROM sys.databases

DECLARE @db_count int = (SELECT COUNT(*) FROM @db_name) WHILE (@db_count> 0) BEGIN

DECLARE @vdbname varchar(100) = (SELECT dbname FROM @db_name WHERE R_DB = @db_count) DELETE FROM @tbl_name

INSERT INTO @tbl_name EXEC('USE ['+@vdbname+'] SELECT TOP 1 ROW_NUMBER OVER(ORDER BY TABLE_CATALOG) AS R_Num, TABLE_CATALOG, TABLE_NAME, COLUMN_NAME, DATA_TYPE, 'SELECT COUNT(*) FROM + TABLE_CATALOG +..+TABLE_NAME+ WHERE + COLUMN_NAME + LIKE %India% ', 0 FROM INFORMATION_SCHEMA.COLUMNS as a WHERE DATA_TYPE IN (varchar, nvarchar, text) AND exists(select * from sys.tables as t where t.name = a.TABLE_NAME)') DECLARE @tbl_count int = (SELECT COUNT(*) FROM @tbl_name) WHILE (@tbl_count> 0) BEGIN DECLARE @vtblname varchar(1000) = (SELECT queries FROM @tbl_name WHERE R_T = @tbl_count) EXECUTE(@vtblname)

SET @tbl_count = @tbl_count -1 END

SET @db_count = @db_count -1 END

SELECT * FROM @tbl_name

--EXEC('USE ['+@vdbname+'] SELECT SELECT COUNT(*) AS C FROM + TABLE_CATALOG +..+TABLE_NAME+ WHERE + COLUMN_NAME + LIKE '%India%'  FROM INFORMATION_SCHEMA.COLUMNS as a WHERE DATA_TYPE IN (varchar, nvarchar, text) AND exists(select * from sys.tables as t where t.name = a.TABLE_NAME)')

sdf
DECLARE @db_name TABLE(R_DB int, dbname VARCHAR(1000)) DECLARE @tbl_name TABLE(R_T int, dbname VARCHAR(1000), tblname VARCHAR(1000), colname VARCHAR(1000), datatype VARCHAR(1000), queries VARCHAR(4000), ccount INT)

DELETE FROM @db_name

INSERT INTO @db_name SELECT TOp 1 ROW_NUMBER OVER(ORDER BY name) AS R_DB, name FROM sys.databases

DECLARE @db_count int = (SELECT COUNT(*) FROM @db_name) WHILE (@db_count> 0) BEGIN

DECLARE @vdbname varchar(100) = (SELECT dbname FROM @db_name WHERE R_DB = @db_count) DELETE FROM @tbl_name

INSERT INTO @tbl_name EXEC('USE ['+@vdbname+'] SELECT TOP 1 ROW_NUMBER OVER(ORDER BY TABLE_CATALOG) AS R_Num, TABLE_CATALOG, TABLE_NAME, COLUMN_NAME, DATA_TYPE, 'SELECT COUNT(*) FROM + TABLE_CATALOG +..+TABLE_NAME+ WHERE + COLUMN_NAME + LIKE %India% ', 0 FROM INFORMATION_SCHEMA.COLUMNS as a WHERE DATA_TYPE IN (varchar, nvarchar, text) AND exists(select * from sys.tables as t where t.name = a.TABLE_NAME)') DECLARE @tbl_count int = (SELECT COUNT(*) FROM @tbl_name) WHILE (@tbl_count> 0) BEGIN DECLARE @vtblname varchar(1000) = (SELECT queries FROM @tbl_name WHERE R_T = @tbl_count) EXECUTE(@vtblname)

SET @tbl_count = @tbl_count -1 END

SET @db_count = @db_count -1 END

SELECT * FROM @tbl_name

--EXEC('USE ['+@vdbname+'] SELECT SELECT COUNT(*) AS C FROM + TABLE_CATALOG +..+TABLE_NAME+ WHERE + COLUMN_NAME + LIKE '%India%'  FROM INFORMATION_SCHEMA.COLUMNS as a WHERE DATA_TYPE IN (varchar, nvarchar, text) AND exists(select * from sys.tables as t where t.name = a.TABLE_NAME)')